-
Notifications
You must be signed in to change notification settings - Fork 15
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
Complete Compilation: autosnoop
? --compile=all
? Disable compilation at runtime?
#24
Comments
If the JIT will still be available at runtime (which it probably will be in most cases), a good option is |
Thanks Jeff, that's excellent. I'm playing around with it now! |
Unfortunately, it doesn't look like this simple precompile trick will work.. If I generalize correctly from this example, it looks like julia0.7> foo(x) = 3 + x - 2 + x*x + x^2 + 2 - 1 / x
>> foo (generic function with 1 method)
julia0.7> bar(x) = foo(x) + x
>> bar (generic function with 1 method)
julia0.7> @time precompile(bar, (Int64,)) # First time is slow, actually compiling.
0.021747 seconds (25.83 k allocations: 1.385 MiB, 33.75% gc time)
>> true
julia0.7> @time precompile(bar, (Int64,)) # This time is fast.
0.000013 seconds (7 allocations: 320 bytes)
>> true
julia0.7> @time precompile(foo, (Int64,)) # First time is slow again, which means `foo` didn't get compiled from `precompile(bar)`
0.003393 seconds (77 allocations: 5.063 KiB)
>> true
julia0.7> @time precompile(foo, (Int64,)) # This time is fast.
0.000015 seconds (7 allocations: 320 bytes)
>> true So probably if the solution ends up taking an |
Cool!! So just simply adding So I can confirm that it is compiling everything ahead of time with NOTE: Just doing However, interestingly, with |
Haha damn, these apps are half a Gig each... yeesh. What's Electron 350MB for?? Anyway, i've uploaded them here for anyone following along, if you want to compare them yourself! :) |
Figure out how to really, actually compile everything at build-time and do no compilation at runtime!!
There was some discussion in-person at JuliaCon around the fact that things aren't being compiled fully because we're only building with
--compile=yes
instead of--compile=all
. (During the talk I incorrectly said that we were building with--compile=all
.)Therefore, the belief is that julia is only precompiling everything (parsing and lowering) rather than compiling to machine code. Some possible fixes we've discussed:
autosnoop
the day before my talk, which just creates asnoopfile
with the contentsjulia_main([""])
, causing the program to be executed during compilation, building a snoopfile, and compiling with it.precompile(julia_main, (Array{String, 1},))
--compile=all
--compile=none
at runtime (i guess this would be passed via the C api'sjl_options
tojulia_init
).The text was updated successfully, but these errors were encountered: