Skip to content

loader-opt: keep JIT metadata line file indexes - #11292

Open
josevalim wants to merge 1 commit into
erlang:masterfrom
josevalim:jv-loader-opt-metadata
Open

loader-opt: keep JIT metadata line file indexes#11292
josevalim wants to merge 1 commit into
erlang:masterfrom
josevalim:jv-loader-opt-metadata

Conversation

@josevalim

Copy link
Copy Markdown
Contributor

JIT metadata line entries already reference source files by index in the module line table. Preserve that shape in the intermediate JIT metadata representation by storing one converted file table alongside the ranges, and have each LineData entry keep the file index.

This avoids converting and copying the same filename into every line entry while keeping the final expansion at the GDB/perf metadata writers, where those external formats require filename bytes.

Benchmark: generated 100 modules with 100 exported functions each and timed 80 iterations of purging and loading all modules in order via code:load_abs/1 on aarch64-apple-darwin24.6.0. Baseline median/avg/p90: 37,577 / 38,243 / 40,859 us. Candidate median/avg/p90: 36,122 / 36,664 / 39,144 us.

JIT metadata line entries already reference source files by index in
the module line table. Preserve that shape in the intermediate JIT
metadata representation by storing one converted file table alongside
the ranges, and have each LineData entry keep the file index.

This avoids converting and copying the same filename into every line
entry while keeping the final expansion at the GDB/perf metadata
writers, where those external formats require filename bytes.

Benchmark: generated 100 modules with 100 exported functions each and
timed 80 iterations of purging and loading all modules in order via
code:load_abs/1 on aarch64-apple-darwin24.6.0. Baseline median/avg/p90:
37,577 / 38,243 / 40,859 us. Candidate median/avg/p90:
36,122 / 36,664 / 39,144 us.
@josevalim josevalim mentioned this pull request Jun 25, 2026
@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

CT Test Results

    3 files    136 suites   50m 29s ⏱️
1 679 tests 1 622 ✅ 57 💤 0 ❌
2 321 runs  2 246 ✅ 75 💤 0 ❌

Results for commit d590770.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@bjorng

bjorng commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

I suggest adding this PR identifier to OTP-20221 after reviewing and merging.

@bjorng bjorng added the team:VM Assigned to OTP team VM label Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team:VM Assigned to OTP team VM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants