You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
int/float specializations should mutate the LHS in-place when possible #90530
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/brandtbucher'closed_at=Nonecreated_at=<Date2022-01-14.06:42:28.312>labels= ['interpreter-core', '3.11', 'performance']
title='int/float specializations should mutate the LHS in-place when possible'updated_at=<Date2022-01-31.18:57:11.093>user='https://github.com/brandtbucher'
The performance of our existing int and float specializations can be improved by mutating the LHS operand in-place when possible. This leads to significant speedups for several number-crunching benchmarks, and a solid 1% improvement overall:
Slower (16):
regex_effbot: 3.14 ms +- 0.01 ms -> 3.26 ms +- 0.03 ms: 1.04x slower
pidigits: 197 ms +- 0 ms -> 203 ms +- 0 ms: 1.03x slower
pickle_list: 4.40 us +- 0.05 us -> 4.51 us +- 0.05 us: 1.02x slower
Since we decided to wait on the int operations while longobject.c is being refactored (faster-cpython/ideas#245), can you clarify whether the speedup reported is from code where it is implemented only for floats, or is it from a prototype where it's implemented for floats and ints?
Activity
brandtbucher commentedon Jan 14, 2022
The performance of our existing int and float specializations can be improved by mutating the LHS operand in-place when possible. This leads to significant speedups for several number-crunching benchmarks, and a solid 1% improvement overall:
Slower (16):
Faster (24):
Benchmark hidden because not significant (18): chameleon, django_template, logging_simple, mako, meteor_contest, pathlib, pyflate, regex_compile, richards, scimark_sor, sqlite_synth, sympy_expand, sympy_str, tornado_http, unpickle, unpickle_list, xml_etree_parse, xml_etree_iterparse
Geometric mean: 1.01x faster
gvanrossum commentedon Jan 31, 2022
Since we decided to wait on the int operations while longobject.c is being refactored (faster-cpython/ideas#245), can you clarify whether the speedup reported is from code where it is implemented only for floats, or is it from a prototype where it's implemented for floats and ints?