That doesn't sound like an improvement to the dependencies loading... Which for me happens every time I change a struct and must reload Julia (which happens a lot when I'm prototyping code, which is what I do 90% of the time)...
That doesn't sound like an improvement to the dependencies loading... Which for me happens every time I change a struct and must reload Julia (which happens a lot when I'm prototyping code, which is what I do 90% of the time)...
This gives the package authors a tool to basically "profile" the loading time of their package, which will help them optimize the loading time. So there _will_ be downstream improvement to package loading for us users too.
> Which for me happens every time I change a struct and must reload Julia (which happens a lot when I'm prototyping code, which is what I do 90% of the time)
The workaround involving `MyClass = MyClass1` that a sibling comment mentions comes from [this Revise.jl manual page](https://timholy.github.io/Revise.jl/stable/limitations/). Revise in general enables a few different ways to work around this, and it's useful to integrate into your workflow (as much as it feels weird at first to go from full REPL to half REPL-half editor).
```
struct MyClass1
...
endMyClass = MyClass1
```
Then, whenever you need to change MyClass, just add 1 to the version number of MyClass in those two or three instances, and the repl will just compile MyClass2 as a new class to be used for all future calls in the repl.
About your issue, things you can do: - Put the struct inside another module. - Use this package: https://github.com/BeastyBlacksmith/ProtoStructs.jl . It gives you a simple @proto macro that you can prepend to the struct definition and makes all changes immediate.
If it was stackoverflow, I would have accepted this answer with a kind comment :-) Thanks !
It lead to https://github.com/SciML/RecursiveArrayTools.jl/pull/217 . 6228.5 ms to 292.7 ms isn't too shabby.
and ProtoStructs: https://github.com/BeastyBlacksmith/ProtoStructs.jl
I’ve never tried them, but they’re advertised as doing the job.
Addendum for those who are new to this, the idea is to use these macros during development, and then get rid of them once the types stabilize (since they tend to have a performance cost).
module X struct etc... end end #module
Change without reloading.
https://julialang.org/blog/2022/08/julia-1.8-highlights/#imp...
The core devs also said that they are aiming to cache native code in the next year or so.
Is Julia "doomed" on this issue or is it just that they prefer to work on other use cases first ?
But there is a project to cache native code (without needing to build a sysimage) that may make a huge difference...
* It's been reduced by like 75% (roughly, not sure about the real number) since Julia 1.0, so material progress has been made.
* In the future (I'm guessing 1-2 years, of course uncertain), native code caching could make a huge difference.
* On a similar timescale, Julia could allow compilation into static binaries. This could possibly be done for some dependencies that does not need to be generic, which would take another chunk of the compilation need off.
ReplMaker.jl can make this process more convenient, but in version 1.9, there’ll be a facility for that built into the regular REPL.