# Is there a way to manually trigger a world\_age update?

**URL:** https://discourse.julialang.org/t/is-there-a-way-to-manually-trigger-a-world-age-update/7776
**Category:** General Usage
**Tags:** question, world\_age
**Created:** [December 15, 2017, 1:36am UTC](https://discourse.julialang.org/t/is-there-a-way-to-manually-trigger-a-world-age-update/7776 "2017-12-15T01:36:05Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [December 15, 2017, 3:14am UTC](https://discourse.julialang.org/t/is-there-a-way-to-manually-trigger-a-world-age-update/7776/2 "2017-12-15T03:14:41Z")

</div>

I’m confused about what you are trying to do.

`invokelatest` is needed when you are in a function `f` trying to call a function `g`, but you want to invoke a version of `g` that is newer that the version of `f` that is _currently running_. The “current world” is the **age of the code that is currently running**.

You obviously cannot recompile `f` _while_ you are running it. But this means that you can’t invoke `g` in the “normal” way — for a normal function call, `g` might have been inlined (which will obviously not call the latest version). Also, when `f` was compiled, type inference (hopefully) determined the return type of `g` and specialized `f`’s code for that result … the latest `g` may have changed its return type.

So, `invokelatest(g, ...)` calls `g` in a way that always chases the `Function` pointer, and the compilation of `f` assumes that the return type is `Any` (i.e. the result is type unstable, because the return type of `g` may change). This obviously hurts performance, which is why you only use `invokelatest` in specialized circumstances.

---

_[View the full topic](https://discourse.julialang.org/t/is-there-a-way-to-manually-trigger-a-world-age-update/7776)._
