Accelerate precompilation of base

Hello,

I’m trying out a feature which requires me re-compile libjulia everytime. Sometimes, even the recompilation of Julia files under base/ is invoked, but this operation has been very time consuming. The compilation of precompile.jl is especially time consuming, taking around 15 mins.

Is there a way to accelerate this precompilation step ? Like spawning parallel Julia jobs ?

Thanks,
Sanjay

There’s currently no way to do that and that’s one of the reasons why we want to split the Base.

Now that #265 is fixed, you don’t have to recompile julia in many cases. Just overwrite Base functions for testing.

Didn’t get you here.

julia> Base.sin(x::Float64) = 1
WARNING: Method definition sin(Float64) in module Math at math.jl:416 overwritten in module Main at REPL[1]:1.

julia> sin(1.0)
1

Oh ok. But, I have to reinvoke julia after recompilation since I’m working on Polly. So this[quote=“yuyichao, post:4, topic:3594”]
julia> Base.sin(x::Float64) = 1
[/quote]

this redefinition doesn’t carry across invocations of julia right ?

So just run it every time you restart julia. If you didn’t change any sysimg code and just need to recompile C++ part, you can just compile the julia-ui-release or julia-ui-debug targets to make sure there isn’t a recompilation from version number bump. Then you can just put all julia testing and monkey patching code in a separate script.

It’s even easier to just use @eval Base. That way the entire method definitions get evaluated within Base’s context — you can straight-up copy-paste code from Base and just wrap it in @eval Base begin … end with your modifications.

2 Likes