Found while measuring package compilability. Not a correctness bug — filing so the cost is recorded.
Compiling mysql2 from real source took 6m50s, dominated by a single module:
node_modules/mysql2/lib/constants/errors.js, a ~3973-line flat table of exports.X = N assignments.
It hit Perry's relocation-estimate cap (15,849 call sites against a 32M cap) and fell back to precise
shadow-frame codegen, which spent 138 seconds on that one LLVM unit alone.
A large flat constant-table module is a common shape in generated or protocol-constant files (error codes, opcode
tables, charset maps), so this is unlikely to be unique to mysql2. Worth checking whether the relocation estimate
is over-counting for a module that is almost entirely simple assignments with no real call graph — a flat
exports.X = <literal> table should be one of the cheapest things to compile, not the most expensive.
Context: this came out of a probe establishing which npm packages compile natively, as part of removing Perry's
hand-written Rust reimplementations in favour of the real packages. mysql2 compiles ✓ but fails at runtime for a
separate reason (#10661).
Found while measuring package compilability. Not a correctness bug — filing so the cost is recorded.
Compiling
mysql2from real source took 6m50s, dominated by a single module:node_modules/mysql2/lib/constants/errors.js, a ~3973-line flat table ofexports.X = Nassignments.It hit Perry's relocation-estimate cap (15,849 call sites against a 32M cap) and fell back to precise
shadow-frame codegen, which spent 138 seconds on that one LLVM unit alone.
A large flat constant-table module is a common shape in generated or protocol-constant files (error codes, opcode
tables, charset maps), so this is unlikely to be unique to mysql2. Worth checking whether the relocation estimate
is over-counting for a module that is almost entirely simple assignments with no real call graph — a flat
exports.X = <literal>table should be one of the cheapest things to compile, not the most expensive.Context: this came out of a probe establishing which npm packages compile natively, as part of removing Perry's
hand-written Rust reimplementations in favour of the real packages.
mysql2compiles ✓ but fails at runtime for aseparate reason (#10661).