Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up bootstrap __build_class__ a little bit #426

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

tekknolagi
Copy link
Owner

Since we're iterating over the layouts table one by one, and the layouts table will always be at least LayoutId::kLastBuiltinId layouts long, use Runtime::layoutAt instead of Runtime::layoutAtSafe, which does a bunch of checks. This search is still linear and kind of long, though.

@github-actions
Copy link

Summary

Metric Average Best Worst Notes
cg_instructions -0.0% loadproperty -0.1% pyflate -0.0% typically < 0.2% noise

Base vs. New

benchmark cg_instructions
2to3 -0.0%
bench_base64 -0.0%
bench_pickle -0.0%
deltablue -0.0%
fannkuch -0.0%
go -0.0%
loadproperty -0.1%
nbody -0.0%
nqueens -0.0%
pyflate -0.0%
pystone -0.0%
richards -0.0%

CPython vs New

benchmark cg_instructions
2to3 -4.9%
bench_base64 -37.4%
bench_pickle -18.5%
deltablue -64.3%
fannkuch 0.5%
go -63.4%
loadproperty -74.6%
nbody 23.5%
nqueens 45.8%
pyflate -30.5%
pystone -71.1%
richards -79.6%

Base

benchmark cg_instructions
2to3 2,437,961,900
bench_base64 3,016,851,640
bench_pickle 3,377,761,245
deltablue 1,472,154,711
fannkuch 5,623,193,634
go 1,927,823,470
loadproperty 443,757,304
nbody 9,628,670,603
nqueens 3,227,848,546
pyflate 10,052,583,375
pystone 1,150,087,213
richards 985,751,874

New

benchmark cg_instructions
2to3 2,437,759,495
bench_base64 3,016,639,065
bench_pickle 3,377,448,086
deltablue 1,471,938,135
fannkuch 5,622,975,914
go 1,927,591,646
loadproperty 443,533,351
nbody 9,628,444,593
nqueens 3,227,622,501
pyflate 10,052,353,183
pystone 1,149,852,950
richards 985,517,204

CPython

benchmark cg_instructions
2to3 2,563,386,938
bench_base64 4,817,675,046
bench_pickle 4,144,883,649
deltablue 4,118,306,138
fannkuch 5,594,116,616
go 5,264,496,480
loadproperty 1,747,782,927
nbody 7,793,828,860
nqueens 2,213,992,826
pyflate 14,465,369,585
pystone 3,981,020,686
richards 4,820,465,409

Since we're iterating over the layouts table one by one, and the layouts
table will always be at least LayoutId::kLastBuiltinId layouts long, use
`Tuple::at` instead of `Runtime::layoutAtSafe`, which does a bunch of
checks. This search is still linear and kind of long, though.
@github-actions
Copy link

Summary

Metric Average Best Worst Notes
cg_instructions -0.0% loadproperty -0.1% pyflate -0.0% typically < 0.2% noise

Base vs. New

benchmark cg_instructions
2to3 -0.0%
bench_base64 -0.0%
bench_pickle -0.0%
deltablue -0.0%
fannkuch -0.0%
go -0.0%
loadproperty -0.1%
nbody -0.0%
nqueens -0.0%
pyflate -0.0%
pystone -0.0%
richards -0.0%

CPython vs New

benchmark cg_instructions
2to3 -4.9%
bench_base64 -37.4%
bench_pickle -18.5%
deltablue -64.3%
fannkuch 0.5%
go -63.4%
loadproperty -74.6%
nbody 23.5%
nqueens 45.8%
pyflate -30.5%
pystone -71.1%
richards -79.6%

Base

benchmark cg_instructions
2to3 2,437,961,900
bench_base64 3,016,851,640
bench_pickle 3,377,761,245
deltablue 1,472,154,711
fannkuch 5,623,193,634
go 1,927,823,470
loadproperty 443,757,304
nbody 9,628,670,603
nqueens 3,227,848,546
pyflate 10,052,583,375
pystone 1,150,087,213
richards 985,751,874

New

benchmark cg_instructions
2to3 2,437,727,592
bench_base64 3,016,607,162
bench_pickle 3,377,416,183
deltablue 1,471,906,232
fannkuch 5,622,944,011
go 1,927,559,743
loadproperty 443,501,448
nbody 9,628,412,690
nqueens 3,227,590,598
pyflate 10,052,321,280
pystone 1,149,821,047
richards 985,485,301

CPython

benchmark cg_instructions
2to3 2,563,386,945
bench_base64 4,817,675,046
bench_pickle 4,144,883,649
deltablue 4,118,306,138
fannkuch 5,594,116,623
go 5,264,496,480
loadproperty 1,747,782,934
nbody 7,793,830,178
nqueens 2,213,992,833
pyflate 14,465,369,585
pystone 3,981,020,686
richards 4,820,465,409

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