Skip to content

[Flight] Pass line/column to filterStackFrame #33707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

eps1lon
Copy link
Collaborator

@eps1lon eps1lon commented Jul 5, 2025

Stacked on #33706

filterStackFrame implementations can fast-path ignore-listing by checking if the corresponding source map ignore-lists everything. However, this check requires checking every section for Index Source Maps which deopts the fast-path check from a constant check (comparing .length) to looping through every section (i.e. O(N)).

By passing in the relevant line and column, a filterStackFrame implementation can find the relevant section with binary search (O(log N)) e.g. https://github.com/vercel/next.js/blob/cc27c243af15703ee4f1bce2dd0afa6960a0f011/packages/next/src/server/lib/source-maps.ts#L60-L82

@eps1lon eps1lon changed the title [Flight] Pass line/column to filterStackFrame [Flight] Pass line/column to filterStackFrame Jul 5, 2025
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Jul 5, 2025
@react-sizebot
Copy link

react-sizebot commented Jul 5, 2025

Comparing: 9a645e1...28b08da

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.68 kB 6.68 kB = 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 530.50 kB 530.50 kB = 93.66 kB 93.66 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB = 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 655.04 kB 655.04 kB = 115.35 kB 115.35 kB
facebook-www/ReactDOM-prod.classic.js = 675.12 kB 675.12 kB = 118.77 kB 118.77 kB
facebook-www/ReactDOM-prod.modern.js = 665.54 kB 665.54 kB = 117.13 kB 117.13 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 28b08da

@eps1lon eps1lon requested a review from sebmarkbage July 5, 2025 16:49
@eps1lon eps1lon marked this pull request as ready for review July 5, 2025 16:49
@eps1lon eps1lon force-pushed the sebbie/filterstackframe-indexsourcemap branch 2 times, most recently from 27aa4d1 to 8c852b6 Compare July 7, 2025 07:46
@eps1lon eps1lon force-pushed the sebbie/filterstackframe-indexsourcemap branch from 8c852b6 to 28b08da Compare July 7, 2025 07:48
@eps1lon eps1lon merged commit bb40287 into facebook:main Jul 7, 2025
241 checks passed
@eps1lon eps1lon deleted the sebbie/filterstackframe-indexsourcemap branch July 7, 2025 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants