https://pantsbuild.org/ logo
#development
Title
# development
w

witty-crayon-22786

03/05/2021, 5:52 PM
are we using python 3.8 syntax yet? and if so: https://pantsbuild.slack.com/archives/CASMF8SJ1/p1614966738001200
h

hundreds-father-404

03/05/2021, 5:53 PM
I wish so badly that we could use py38
but no, we have to support Py37 for now. I think the best path forward would probably be distributing Pants as a Rust binary
e

enough-analyst-54434

03/05/2021, 6:31 PM
It's probably because I maintain a 2.7 compatible codebase, but beyond language features we should at least be aware of perf. 2.7 crushes 3.x. 3.6 is particularly bad but 3.9 has not caught up.
h

happy-kitchen-89482

03/05/2021, 6:33 PM
I was not aware of that, and it makes me sad.
e

enough-analyst-54434

03/05/2021, 6:34 PM
If it weren't for, well lots of other reasons, we really need to be moving forward, it would be emarrasing that we use 3 on the perf front since we rely on none of it's features. Typing, coroutines, attrs - all available in 2.7.
w

witty-crayon-22786

03/05/2021, 6:35 PM
empirically, the port from python 2 to 3 sped up pants at twitter by quite a bit
👍 1
which benchmarks are you referencing?
e

enough-analyst-54434

03/05/2021, 6:36 PM
The umpteen I do daily against the 10s of interpreters on my machine with Pex using hyperfine.
h

hundreds-father-404

03/05/2021, 6:36 PM
the port from python 2 to 3 sped up pants at twitter by quite a bit
https://twitter.com/EArellanoAZ/status/1142213266384416773?s=20
e

enough-analyst-54434

03/05/2021, 6:37 PM
Pex is slower. That's all I know.
w

witty-crayon-22786

03/05/2021, 6:37 PM
pyoxidizer might eventually unlock us embedding Pypy… but i think that that would require using a different embedding API than …
cpython
👍 1
…oh. hm. https://github.com/PyO3/pyo3#usage , the fork of
cpython
seems to support pypy.
e

enough-analyst-54434

03/05/2021, 6:38 PM
PyPy beta is 3.7
3.6 is stable
They won't support 3.8 for a long while likely.
Clearly Pex is a lot less complex than Pants and is not a daemon. Good for perf stability test, bad for comparsion - still wondering how Pants could be faster if it truly was only 2->3 and not other bits mixed in though:
Copy code
$ hyperfine --warmup 2 -L rev '2.7,3.5,3.6,3.7,3.8,3.9' 'python{rev} dist/pex --help'
Benchmark #1: python2.7 dist/pex --help
  Time (mean ± σ):     285.2 ms ±   1.8 ms    [User: 244.3 ms, System: 39.0 ms]
  Range (min … max):   282.9 ms … 288.6 ms    10 runs
 
Benchmark #2: python3.5 dist/pex --help
  Time (mean ± σ):     757.1 ms ±   8.3 ms    [User: 708.3 ms, System: 45.6 ms]
  Range (min … max):   743.2 ms … 767.2 ms    10 runs
 
Benchmark #3: python3.6 dist/pex --help
  Time (mean ± σ):     754.3 ms ±   8.7 ms    [User: 709.7 ms, System: 40.9 ms]
  Range (min … max):   744.2 ms … 768.7 ms    10 runs
 
Benchmark #4: python3.7 dist/pex --help
  Time (mean ± σ):     311.7 ms ±   4.0 ms    [User: 279.3 ms, System: 30.6 ms]
  Range (min … max):   304.2 ms … 318.0 ms    10 runs
 
Benchmark #5: python3.8 dist/pex --help
  Time (mean ± σ):     345.7 ms ±   3.0 ms    [User: 317.5 ms, System: 27.4 ms]
  Range (min … max):   343.2 ms … 353.5 ms    10 runs
 
Benchmark #6: python3.9 dist/pex --help
  Time (mean ± σ):     382.4 ms ±   2.9 ms    [User: 341.4 ms, System: 39.2 ms]
  Range (min … max):   377.7 ms … 386.4 ms    10 runs
 
Summary
  'python2.7 dist/pex --help' ran
    1.09 ± 0.02 times faster than 'python3.7 dist/pex --help'
    1.21 ± 0.01 times faster than 'python3.8 dist/pex --help'
    1.34 ± 0.01 times faster than 'python3.9 dist/pex --help'
    2.64 ± 0.03 times faster than 'python3.6 dist/pex --help'
    2.65 ± 0.03 times faster than 'python3.5 dist/pex --help'
This is totally typical in my day to day experience.