Skip to content

Conversation

tekknolagi
Copy link
Owner

This saves on allocations. It's a little finicky, though, since it
relies on a series of three LOAD_CONST with no EXTENDED_ARG.

@tekknolagi
Copy link
Owner Author

TODO: add tests

@tekknolagi
Copy link
Owner Author

An alternative idea: do this in the compiler. Unfortunately this means adding new marshaling and unmarshaling for slices and that seems more invasive.

This saves on allocations. It's a little finicky, though, since it
relies on a series of three LOAD_CONST with no EXTENDED_ARG.
@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions
Copy link

Summary

Metric Average Best Worst Notes
cg_instructions 0.5% fannkuch 0.0% nqueens 3.0% typically < 0.2% noise
Benchmark details

Base vs. New

benchmark cg_instructions
2to3 0.1%
bench_base64 0.2%
bench_compile 0.6%
bench_pickle 0.2%
deltablue 0.3%
fannkuch 0.0%
go 0.3%
loadproperty 1.1%
nbody 0.1%
nqueens 3.0%
pyflate 0.0%
pystone 0.4%
richards 0.5%

CPython vs New

benchmark cg_instructions
2to3 -8.2%
bench_base64 -38.5%
bench_compile 1125.7%
bench_pickle -19.1%
deltablue -64.3%
fannkuch -1.7%
go -63.8%
loadproperty -74.8%
nbody 22.2%
nqueens 46.6%
pyflate -31.3%
pystone -71.6%
richards -79.9%

Base

benchmark cg_instructions
2to3 2,351,294,592
bench_base64 2,960,306,334
bench_compile 3,014,236,993
bench_pickle 3,348,431,666
deltablue 1,462,407,738
fannkuch 5,500,944,998
go 1,901,340,490
loadproperty 435,662,650
nbody 9,515,556,698
nqueens 3,149,386,863
pyflate 9,942,548,610
pystone 1,124,779,200
richards 966,157,436

New

benchmark cg_instructions
2to3 2,353,187,673
bench_base64 2,965,421,664
bench_compile 3,031,810,010
bench_pickle 3,353,877,017
deltablue 1,467,459,656
fannkuch 5,501,326,423
go 1,906,526,645
loadproperty 440,629,055
nbody 9,520,537,575
nqueens 3,245,419,927
pyflate 9,944,682,455
pystone 1,129,772,318
richards 971,169,185

CPython

benchmark cg_instructions
2to3 2,563,516,982
bench_base64 4,820,256,525
bench_compile 247,353,166
bench_pickle 4,145,151,943
deltablue 4,109,392,466
fannkuch 5,594,123,299
go 5,264,677,544
loadproperty 1,747,788,203
nbody 7,793,833,304
nqueens 2,213,199,125
pyflate 14,468,078,381
pystone 3,981,557,801
richards 4,821,532,606

@tekknolagi
Copy link
Owner Author

Better idea: python/cpython#94168

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant