Skip to content
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

Speed up compilation by 20 seconds #11361

Closed
wants to merge 1 commit into from

Conversation

yuyichao
Copy link
Contributor

Do not run precompilation for sys0. It is pretty much a waste of time and many of the precompiled function are not useful for bootstrap anyway. There might be other files that can be omitted for sys0 but this should be the safest one.

On my laptop after this change the compilation time of sys.so changed from 2:26 to 2:28 (which is smaller than the fluctuation) and the compilation time of sys0.so plus sys.so goes down from 5:04 to 4:44.

For clean compilation, this should save some time. For recompilation, sys.so is usually used anyway so it shouldn't be slower.

P.S. The main purpose of this PR is to make me feel less guilty by making the CI slower with #11358 and #11359 .

P.P.S. (Edit) Hopefully no one have mis-read my title as 20x. No, sadly it's only 20 seconds.

@yuyichao yuyichao changed the title Speed up compilation by 20s. Speed up compilation by 20 seconds May 19, 2015
@yuyichao
Copy link
Contributor Author

Hmmm. Is JLOptions().image_file not working on windows? It seems that AppVeyor is not including precompile.jl even for sys.so??

@ihnorton
Copy link
Member

On a local build the image_file variable is as-expected: first stage it is NULL, second stage it is the expected path.

@yuyichao yuyichao force-pushed the sys0-opt branch 2 times, most recently from cc4ad31 to 5e4643b Compare May 20, 2015 13:37
@yuyichao
Copy link
Contributor Author

I've just pushed a new version to see whats happening on the windows CI.
Please feel free to abort the previous one. (Actually, please abort the previous one....)

@yuyichao
Copy link
Contributor Author

I'm wondering if this is a printing issue on windows. AppVeyor has time stamp for each line and for generating sys.ji it spent way too long on the basedocs.jl so I guess it actually included precompile.jl but didn't print it?

Actually how is the printing of included file names done at sysimg build time?

@ihnorton
Copy link
Member

Was just writing the same thing. Very strange. Perhaps put some debug output in precompile.jl itself?

@ihnorton
Copy link
Member

Actually how is the printing of included file names done at sysimg build time?

https://github.com/JuliaLang/julia/blob/master/src/toplevel.c#L583-L587

@yuyichao
Copy link
Contributor Author

... OK try again...

I'm glad the CI is not so busy at the moment....

@yuyichao
Copy link
Contributor Author

@yuyichao
Copy link
Contributor Author

Let's see what the CI think this time.
Maybe related to #11017

@yuyichao
Copy link
Contributor Author

Interesting!

So the output shifts by one line only for sys.ji ???
https://ci.appveyor.com/project/StefanKarpinski/julia/build/1.0.4858/job/33k6ne5suyr4gmav#L952

@yuyichao
Copy link
Contributor Author

@tkelman

@yuyichao
Copy link
Contributor Author

I guess this is not needed anymore after #11274. Incidentally, it also seems to fix the missing precompile.jl in the output. (still think it might be related to #11017 though)

@yuyichao yuyichao closed this May 20, 2015
@tkelman
Copy link
Contributor

tkelman commented May 20, 2015

Was there an actual question?

@yuyichao
Copy link
Contributor Author

@tkelman I just think the missing precompile.jl in the output might be related to #11017 and I thought you might have some idea about this (and that issue).

See this AppVeyor build and the corresponding code. The output of addresses is supposed to be arround precompile.jl but they are actually around basedocs.jl. The second precompile.jl is also missing from all the AppVeyor output I checked.

@yuyichao yuyichao deleted the sys0-opt branch May 20, 2015 15:02
@yuyichao
Copy link
Contributor Author

Here's the link to the patch 024f987

The relavant code is here

-include("precompile.jl")
+if !_is_sys0
+    ccall(:jl_, Void, (Any,), "Loading precompile.jl")
+    ccall(:jl_, Void, (Any,), unsafe_load(cglobal(:jl_current_module, Ptr{Void})))
+    ccall(:jl_, Void, (Any,), unsafe_load(cglobal(:jl_base_module, Ptr{Void})))
+    include("precompile.jl")
+end

In case github decided to purge the commit after I deleted the branch.

@tkelman
Copy link
Contributor

tkelman commented May 20, 2015

No, if I knew how to fix #11017 I would have fixed it by now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants