Echoing other's praise for call-by-name week, here...
# development
b
Echoing other's praise for call-by-name week, here's the start-up time for
pants --no-pantsd version
on my real-world work codebase: (Measured with
hyperfine -L version '2.27.0a0,2.28.0.dev0,2.28.0.dev1' -w 2 -r 5 'PANTS_VERSION={version} pants --no-pantsd version'
)
Copy code
Benchmark 1: PANTS_VERSION=2.27.0a0 pants --no-pantsd version
  Time (mean ± σ):      5.580 s ±  0.253 s    [User: 5.164 s, System: 0.297 s]
  Range (min … max):    5.206 s …  5.839 s    5 runs
 
Benchmark 2: PANTS_VERSION=2.28.0.dev0 pants --no-pantsd version
  Time (mean ± σ):      4.783 s ±  0.185 s    [User: 4.467 s, System: 0.267 s]
  Range (min … max):    4.587 s …  5.039 s    5 runs
 
Benchmark 3: PANTS_VERSION=2.28.0.dev1 pants --no-pantsd version
  Time (mean ± σ):      2.938 s ±  0.056 s    [User: 2.726 s, System: 0.183 s]
  Range (min … max):    2.856 s …  3.001 s    5 runs
 
Summary
  PANTS_VERSION=2.28.0.dev1 pants --no-pantsd version ran
    1.63 ± 0.07 times faster than PANTS_VERSION=2.28.0.dev0 pants --no-pantsd version
    1.90 ± 0.09 times faster than PANTS_VERSION=2.27.0a0 pants --no-pantsd version
5.6s -> 2.9s 🎉
😮 1
🎉 5
g
That is very nice 🙂
b
The call-by-name wins keep coming: on my work repo, the start-up time has continued to drop since I last checked: • 5.3s (2.27) • 2.0s (2.28.0a0) • 1.9s (2.29.0dev0) Well done everyone.
Copy code
hyperfine -L version '2.27.0,2.28.0.dev1,2.28.0a0,2.29.0.dev0' -w 2 -r 5 'PANTS_VERSION={version} pants --no-pantsd version'
Benchmark 1: PANTS_VERSION=2.27.0 pants --no-pantsd version
  Time (mean ± σ):      5.317 s ±  0.018 s    [User: 5.037 s, System: 0.259 s]
  Range (min … max):    5.297 s …  5.340 s    5 runs
 
Benchmark 2: PANTS_VERSION=2.28.0.dev1 pants --no-pantsd version
  Time (mean ± σ):      2.841 s ±  0.008 s    [User: 2.663 s, System: 0.162 s]
  Range (min … max):    2.834 s …  2.853 s    5 runs
 
Benchmark 3: PANTS_VERSION=2.28.0a0 pants --no-pantsd version
  Time (mean ± σ):      2.035 s ±  0.013 s    [User: 1.889 s, System: 0.128 s]
  Range (min … max):    2.019 s …  2.046 s    5 runs
 
Benchmark 4: PANTS_VERSION=2.29.0.dev0 pants --no-pantsd version
  Time (mean ± σ):      1.871 s ±  0.043 s    [User: 1.732 s, System: 0.117 s]
  Range (min … max):    1.843 s …  1.944 s    5 runs
 
Summary
  PANTS_VERSION=2.29.0.dev0 pants --no-pantsd version ran
    1.09 ± 0.03 times faster than PANTS_VERSION=2.28.0a0 pants --no-pantsd version
    1.52 ± 0.03 times faster than PANTS_VERSION=2.28.0.dev1 pants --no-pantsd version
    2.84 ± 0.07 times faster than PANTS_VERSION=2.27.0 pants --no-pantsd version
👖 6
🔥 4
w
Whoa, that's a big drop in 2.28 - was that the union rule change?
Oh wow, on pants mainline - my test of editing pants.toml to add/remove the prettier backend now takes 2 seconds 🔥 🔥 🔥 On May 15, that same test was 7.5s !!!
I wasn't even able to get below 6 seconds by removing most of the backends from pants.toml during development back a few months ago
cc @happy-kitchen-89482 ^^ I can't think this is related to anything other than the union rule? Unless upgrading pyo3 did this kinda damage
I'm pretty excited about this - because not only is it better DX - but it finally makes the shell completions and my vscode stuff usable without getting randomly hammered by delays
h
I think that big drop was just all the porting everyone did in CBN week
b
Here's the measurements for all recent releases, as a starting point for bisecting (if you care about the specifics)
Copy code
Version      mean   min    max
2.27.0       5.335  5.301  5.419
2.28.0.dev0  4.618  4.571  4.648
2.28.0.dev1  2.877  2.832  3.003
2.28.0.dev2  2.742  2.720  2.780
2.28.0.dev3  2.745  2.734  2.759
2.28.0.dev4  2.748  2.707  2.835
2.28.0a0     2.045  2.027  2.072
2.29.0.dev0  1.843  1.834  1.860
👍 1
h
polymorphic call-by-name should contribute even further, but only once we port more of the union code to use it
w
Interesting. My 7.5s test was roughly at the end of call-by-name week I think - and I didn't think we had a substantial drop since then. Either way, stoked for the results 🤷
b
My memory is that 2.27.0a0 (created on May 13) had a few minor CBN changes, but most of the work for the CBN week landed after 2.27.x branch was cut... as the numbers suggest, especially in time for 2.28.0.dev0 (May 15) and 2.28.0.dev1 (May 20).
Added this to 2.28 release notes in https://github.com/pantsbuild/pants/pull/22470
d
We just upgraded our repo from Pants 2.27 to 2.28 and saw startup times drop by 10x from ~30s to ~3s. We have a decent amount of custom pants plugins, so maybe that has something to do with it? In any case, this is great! Thanks all!
🎉 2
w
And once I figure out how to enable the migration tool, you should be able to cut that down further by migrating your custom plugins
❤️ 1