summaryrefslogtreecommitdiffstats
path: root/contrib/python/ipython/py2/IPython/extensions
diff options
context:
space:
mode:
authorbabenko <[email protected]>2026-06-14 18:50:09 +0300
committerbabenko <[email protected]>2026-06-14 19:10:22 +0300
commit969f69bfb876d8108e12cd731d24d3b6f984916b (patch)
treedd294da3e5a5db3b5a1709968efad89f410f9b55 /contrib/python/ipython/py2/IPython/extensions
parent14f317964eba1ae01a553ac2e7d4026f2115b205 (diff)
Fold TEnumTraits GetMinValue/GetMaxValue to compile time
GetMinValue()/GetMaxValue() are constexpr, but when called from a runtime context for a large-domain enum, clang does not fold the min/max_element and emits a runtime scan over the whole domain on every call. This is hot on the master replay path: TEnumIndexedArray::operator[] bounds-checks against these (e.g. TCypressManager::FindHandler), and TCompositeAutomaton::RememberReign hits GetCurrentReign() = GetMaxValue() over the ~3300-entry EMasterReign domain per mutation. Bind the result to a constexpr local to force compile-time evaluation. Verified by disasm on a 240-value sample enum: getmin() goes from a ~44-instruction runtime scan to a single 'mov $const'. No behavior change. Part of YT-28453 (master replay-speed optimizations). commit_hash:7cdb969e00ba219415d80c5c8c984aa8bbde99d2
Diffstat (limited to 'contrib/python/ipython/py2/IPython/extensions')
0 files changed, 0 insertions, 0 deletions