Repository navigation
Conversation
|
Although it is definitely a MSVC compiler bug running out of memory during compiling, this seems to be an interesting approach as well which might have pros/cons above my head. cc @serhiy-storchaka who has commited in this domain. |
|
!buildbot ARM64 Windows Non-Debug |
|
🤖 New build scheduled with the buildbot fleet by @hugovk for commit ee8001e 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F156081%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
|
I don't think we should do this to hide an MSVC bug, unless there's additional performance benefits? |
|
From a quick benchmark, this makes lookup slower on Linux. Maybe try two-level tables with the |
|
It is too early for it now. I am planning to add more fields in the database. After that I will optimize its structure, probably by using different tables for different groups of fields. |
Fixes #153668.
Summary
makeunicodedata.pycurrently emits_PyUnicode_ToNumeric()as a switchwith 2,023 case labels. On Windows ARM64, MSVC's
/O2optimizer consumesexcessive memory and the x86-hosted ARM64 compiler fails with C1002 while
compiling
Objects/unicodectype.c.Generate a sorted code-point table, a parallel value-index table, and a
table of the 151 UCD numeric-value entries instead.
_PyUnicode_ToNumeric()now uses binary search and still returns
-1.0for code points without anumeric value.
NUMERIC_MASKand_PyUnicode_IsNumeric()are unchanged.This is a source-level alternative to the temporary build workaround in
#153669. That PR disables optimization for affected MSVC toolsets; this
change keeps optimization enabled by removing the compiler-stressing
generated switch.
Windows ARM64 result
VCTools 14.51.36231, Release
/O2, on a Windows 11 ARM64 lab host:mainValidation
python -m test -j1 test_unicodedata test_str: 212 tests passed.python -m test -j1 -u cpu test_unicodedata: 73 tests passed.python -m test -j0 -x test_profiling: 49,207 tests passed across442 test files.
test_profilingwas excluded because its samplingcoordinator hangs independently on this lab image.
generated switch; all 2,023 numeric mappings and non-numeric results match.
Tools\patchcheck\patchcheck.py: passed.AI assistance: OpenAI Codex assisted with the investigation, implementation,
and validation. This PR is opened as a draft so the submitter can complete
the required human review before marking it ready.