Skip to content

Commit

Permalink
Do not call rand during sysimage precompilation (#56227)
Browse files Browse the repository at this point in the history
This change by itself doesn't do anything significant on `master`, but
when backported to the v1.11 branch it'll address #56177. However it'd
be great if someone could tell _why_ this fixes that issue, because it
looks very unrelated.

---------

Co-authored-by: Ian Butterworth <[email protected]>
  • Loading branch information
giordano and IanButterworth authored Oct 18, 2024
1 parent 82b1506 commit f36f342
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions contrib/generate_precompile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ for match = Base._methods(+, (Int, Int), -1, Base.get_world_counter())
# interactive startup uses this
write(IOBuffer(), "")
# not critical, but helps hide unrelated compilation from @time when using --trace-compile
foo() = rand(2,2) * rand(2,2)
@time foo()
@time foo()
# Not critical, but helps hide unrelated compilation from @time when using --trace-compile.
f55729() = Base.Experimental.@force_compile
@time @eval f55729()
@time @eval f55729()
break # only actually need to do this once
end
Expand Down

0 comments on commit f36f342

Please sign in to comment.