-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TTFX, PrecomopileTools, Loading time #225
Comments
@hhaensel this is amazing in terms of startup time. I need to run the code and check. Things that come to mind and I'll be looking for: |
I think if this works with @page in modules that are more complex, question 3 is negligible. The reduction of memory allocation is amazing! |
I tried setting up this app as a package and loading it with Loading the app the usual way ❯ julia --project -e '@time begin using GenieFramework; Genie.loadapp();up();end'
┌ Info: 2023-11-01 14:35:55
└ Web Server starting at http://127.0.0.1:8000
15.784171 seconds (15.93 M allocations: 1.027 GiB, 4.83% gc time, 64.93% compilation time: 9% of which was recompilation)[ Info: 2023-11-01 14:35:55 Listening on: 127.0.0.1:8000, thread id: 1 Loading the app as a package ❯ julia --project -e "@time begin using Gallery; Gallery.up();end"
┌ Info:
└ Web Server starting at http://127.0.0.1:8000
3.786981 seconds (3.52 M allocations: 211.670 MiB, 6.69% gc time, 1.76% compilation time: 57% of which was recompilation)[ Info: Listening on: 127.0.0.1:8000, thread id: 1 Still, the app doesn't really work when loaded as a package. User-defined routes with |
@PGimenez Where is the code for the package version of the app? |
I ended up trying with the BERT demo since the Gallery one wasn't fully working. Probably due to the way I'm including all the various components. The code is here. All I did was move to a Pkg structure, replace app.jl with Bert.jl, and declare the root path inside the |
If we agree to my latest Genie PR we can simplify loading of local modules via. @using StippleTTFX
@using temp/StippleTTFX2
@using temp\StippleTTFX2
@using "C:/temp with space and colon/StippleTTFX2" |
So where does this stand right now? I'm also running into similar issues with fly... |
The current load process of an App is done internally by
Revise.includet()
.This doesn't take advantage of the fact that the App is typically a module (not necessarily, though) and could be precompiled.
Alternatively one could load the App with a using statement, which speeds up loading drastically and even more when using PrecompileTools.
There are some pitfalls with this approach, but I'd like to discuss what could be the best approach.
Here's my MWE
module MyApp.jl
classical bootstrap.jl
alternative bootstrap.jl
Testing
Result is
4.626385 seconds (2.23 M allocations: 151.089 MiB, 95.21% compilation time: <1% of which was recompilation
0.351679 seconds (58.67 k allocations: 3.758 MiB, 20.45% compilation time)
The text was updated successfully, but these errors were encountered: