Julia 1.11 is slower than 1.10?

So I was reading the blog post and decided to test the speedup of the Stdlib excision section,

% hyperfine 'julia +1.10 --startup-file=no -e "1+1"'
Benchmark 1: julia +1.10 --startup-file=no -e "1+1"
  Time (mean ± σ):     181.7 ms ±   6.3 ms    [User: 107.8 ms, System: 72.8 ms]
  Range (min … max):   173.8 ms … 195.4 ms    16 runs
 
% hyperfine 'julia +1.11 --startup-file=no -e "1+1"'
Benchmark 1: julia +1.11 --startup-file=no -e "1+1"
  Time (mean ± σ):     389.1 ms ±   9.6 ms    [User: 427.0 ms, System: 58.9 ms]
  Range (min … max):   372.1 ms … 400.0 ms    10 runs

Am I missing something?

julia> versioninfo()
Julia Version 1.11.0
Commit 501a4f25c2b (2024-10-07 11:40 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 4 × Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, broadwell)
Threads: 1 default, 0 interactive, 1 GC (on 4 virtual cores)
5 Likes

Yes I’m having the same problem. Before the update I was using 1.10.4 and my program benchmarked at 9.794 ms (Memory estimate: 14.39 MiB, allocs estimate: 52697), but in 1.11 it became 10.669 ms Memory estimate: 14.09 MiB, allocs estimate: 82728 estimate: 82728, I don’t know where the extra 30,000 allocations came from. pprof’s results show an increase in allocations for all functions. Finally a partial screenshot of PProf.Allocs.pprof().


Sorry, but this is a completely different problem, this is no startup overhead. There are a few, known, open performance regressions in 1.11: GitHub · Where software is built

2 Likes

The OP is saying that the blog post claims a speed up for the given script, which he is not able to reproduce. I am also seeing a regression for the same.

Are you saying that to obtain the results given in the blog post we need to create a custom system image?

1 Like

Indeed, there was a regression between the last release candidate and the release:

$ hyperfine './julia-1.10.5/bin/julia --startup-file=no -e "1+1"'
Benchmark 1: ./julia-1.10.5/bin/julia --startup-file=no -e "1+1"
  Time (mean ± σ):     160.0 ms ±   0.9 ms    [User: 77.7 ms, System: 84.9 ms]
  Range (min … max):   158.2 ms … 161.3 ms    18 runs
 
$ hyperfine './julia-1.11.0-rc4/bin/julia --startup-file=no -e "1+1"'
Benchmark 1: ./julia-1.11.0-rc4/bin/julia --startup-file=no -e "1+1"
  Time (mean ± σ):     126.1 ms ±   1.6 ms    [User: 61.7 ms, System: 63.3 ms]
  Range (min … max):   122.8 ms … 128.6 ms    23 runs
 
$ hyperfine './julia-1.11.0/bin/julia --startup-file=no -e "1+1"'
Benchmark 1: ./julia-1.11.0/bin/julia --startup-file=no -e "1+1"
  Time (mean ± σ):     304.6 ms ±   4.4 ms    [User: 528.1 ms, System: 84.3 ms]
  Range (min … max):   300.0 ms … 315.1 ms    10 runs

Maybe because of this additional required compilation:

$ ./julia-1.11.0-rc4/bin/julia --startup-file=no -e "1+1" --trace-compile=stderr
$ ./julia-1.11.0/bin/julia --startup-file=no -e "1+1" --trace-compile=stderr
precompile(Tuple{Base.var"#759#760"{Task}})

Issue:

4 Likes

No. I guess something went wrong with creating the default system image.

I thought the last release candidate became the release, with just a rename. So there can be changes after the last candidate?

5 Likes
2 Likes

Yeah, it seems odd to release a release that was never a release candidate.

3 Likes

And unfortunately, this ( v1.11 generates 50% larger cache files), hasn’t improve either.

Don’t complain, just continue to use 1.10. Julia 1.11 has a lot of new features, it will take some time until the dust settles and everything works better than in 1.10.

5 Likes

Civilization doesn’t follow a straight line; it’s normal for a release to have regressions. The v1.12 release will be better than ever.

1 Like

Is there a specific place where we can report regressions in packages? The Meshes.jl test suite on CI went from 4m (v1.10) to 6m (v1.11).

Reporting broad regressions isn’t especially useful, but if you can narrow down the regression to something specific and reproducible, absolutely report it as a Julia issue!

14 Likes

The “complaints” (I don’t think that’s a fair characterization of the OP actually) are useful to me as an observer interested in how soon I should consider updating. It also sheds light on how stable I should expect new releases to be - like @CameronBieganek, I would have expected it to just be a copy of a previously vetted RC.

Reading discussions here is the only way I can stay abreast of whether we’ve hit that point, I don’t think we should discourage those discussions from taking place.

34 Likes

I feel like julia startup time is just not very stable:

akako@frame16 ~> hyperfine --warmup 1 'julia +1.10.5 --startup-file=no -e "1+1"'
Benchmark 1: julia +1.10.5 --startup-file=no -e "1+1"
  Time (mean ± σ):     141.9 ms ±  21.5 ms    [User: 77.6 ms, System: 98.4 ms]
  Range (min … max):   110.9 ms … 165.7 ms    19 runs

akako@frame16 ~> hyperfine --warmup 1 'julia +1.11.0 --startup-file=no -e "1+1"'
Benchmark 1: julia +1.11.0 --startup-file=no -e "1+1"
  Time (mean ± σ):     191.6 ms ±  91.6 ms    [User: 386.5 ms, System: 82.8 ms]
  Range (min … max):    86.4 ms … 432.4 ms    15 runs

akako@frame16 ~> hyperfine --warmup 1 'julia +1.11.0 --startup-file=no -e "1+1"'
Benchmark 1: julia +1.11.0 --startup-file=no -e "1+1"
  Time (mean ± σ):     152.9 ms ±  58.9 ms    [User: 329.9 ms, System: 58.1 ms]
  Range (min … max):    87.8 ms … 249.5 ms    24 runs

  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.

julia> versioninfo()
Julia Version 1.11.0
Commit 501a4f25c2b (2024-10-07 11:40 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 16 × AMD Ryzen 7 7840HS w/ Radeon 780M Graphics
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, znver4)
Threads: 16 default, 0 interactive, 8 GC (on 16 virtual cores)
Environment:
  JULIA_NUM_THREADS = auto

maybe try --warmup

2 Likes

Are you using a laptop? If you do, put it in performance mode, otherwise the results will be all over the place.

The number of allocations, if the performance does not decrease, is not necessarily an issue. Some of this was discussed here: Increase in allocations with Julia v1.11-beta

5 Likes

I think 1.11.0 is just all over the places:

akako@frame16 ~> cat /sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference
performance
akako@frame16 ~> hyperfine --warmup 1 'julia +1.10.5 --startup-file=no -e "1+1"'
Benchmark 1: julia +1.10.5 --startup-file=no -e "1+1"
  Time (mean ± σ):     112.3 ms ±   2.3 ms    [User: 58.5 ms, System: 70.7 ms]
  Range (min … max):   107.2 ms … 116.7 ms    26 runs

akako@frame16 ~> hyperfine --warmup 1 'julia +1.11.0 --startup-file=no -e "1+1"'
Benchmark 1: julia +1.11.0 --startup-file=no -e "1+1"
  Time (mean ± σ):     110.3 ms ±  49.3 ms    [User: 204.8 ms, System: 44.9 ms]
  Range (min … max):    80.0 ms … 216.3 ms    34 runs

  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.

Pretty reproducible for me:

ufechner@framework:~$ hyperfine 'julia +1.11 -e "1+1"'
Benchmark 1: julia +1.11 -e "1+1"
  Time (mean ± σ):     244.9 ms ±   2.1 ms    [User: 742.6 ms, System: 73.4 ms]
  Range (min … max):   241.7 ms … 249.3 ms    12 runs

Ryzen 7840u, 8 performance cores

2 Likes