Skip to content

lineinfo: Avoid _get_lin vector allocation#838

Open
aviatesk wants to merge 1 commit into
masterfrom
opt-get_lin
Open

lineinfo: Avoid _get_lin vector allocation#838
aviatesk wants to merge 1 commit into
masterfrom
opt-get_lin

Conversation

@aviatesk

@aviatesk aviatesk commented Jul 2, 2026

Copy link
Copy Markdown
Owner

JET locates report sites by asking Compiler.IRShow.buildLineInfoNode and taking the first entry. That helper always allocates a Vector even when _get_lin only needs a single LineInfoNode.

Walk Core.DebugInfo directly in JETBase and track the same update semantics as append_scopes!, including nested linetables, inlining edges, and fallback behavior.

Tests in test/test_misc.jl compare _get_lin against the old buildLineInfoNode-based behavior for direct, indirect, inlined, and invalid debuginfo cases.


The cost of merging this PR is of course the more dependency on the Compiler internals.

JET locates report sites by asking `Compiler.IRShow.buildLineInfoNode`
and taking the first entry. That helper always allocates a Vector even
when `_get_lin` only needs a single LineInfoNode.

Walk `Core.DebugInfo` directly in JETBase and track the same update
semantics as append_scopes!, including nested linetables, inlining
edges, and fallback behavior.

Tests in test/test_misc.jl compare `_get_lin` against the old
`buildLineInfoNode`-based behavior for direct, indirect, inlined, and
invalid debuginfo cases.

Co-Authored-By: GPT-5.5 <noreply@openai.com>
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.17647% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.10%. Comparing base (23d7d7c) to head (358c41f).

Files with missing lines Patch % Lines
src/JETBase.jl 91.17% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #838      +/-   ##
==========================================
+ Coverage   84.05%   84.10%   +0.05%     
==========================================
  Files          12       12              
  Lines        3160     3190      +30     
==========================================
+ Hits         2656     2683      +27     
- Misses        504      507       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant