Skip to content
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

Remove inlining logic in AST (de-)serializer #5455

Merged
merged 6 commits into from Apr 7, 2024

Conversation

lukastaegert
Copy link
Member

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

Description

One outcome of a workshop I recently held was that especially the inlining logic was adding a massive amount of complexity to the AST serializer, especially on the Rust side. This made it much harder for new contributors to understand the process. As I only expect moderate gains from this optimization, I decided to remove it instead. This will become even more relevant when we add string deduplication as that implies that then, strings can never be inlined, so there will only be a few candidates left for inlining.

As another optimization, however, I added logic to list serialization that for an empty list, we can set the position to 0 instead of pointing to a separate list location containing the 0 for its length.

Copy link

vercel bot commented Apr 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rollup ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 5, 2024 1:06pm

Copy link

github-actions bot commented Apr 5, 2024

Thank you for your contribution! ❤️

You can try out this pull request locally by installing Rollup via

npm install rollup/rollup#no-inlined-attributes

Notice: Ensure you have installed Rust nightly. If you haven't installed it yet, please first see https://www.rust-lang.org/tools/install to learn how to download Rustup and install Rust, then see https://rust-lang.github.io/rustup/concepts/channels.html to learn how to install Rust nightly.

or load it into the REPL:
https://rollup-m4e82hyc8-rollup-js.vercel.app/repl/?pr=5455

Copy link

codecov bot commented Apr 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.79%. Comparing base (1b85663) to head (36580dd).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5455   +/-   ##
=======================================
  Coverage   98.79%   98.79%           
=======================================
  Files         238      238           
  Lines        9446     9450    +4     
  Branches     2403     2407    +4     
=======================================
+ Hits         9332     9336    +4     
  Misses         48       48           
  Partials       66       66           

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

@lukastaegert lukastaegert merged commit edc1504 into master Apr 7, 2024
30 checks passed
@lukastaegert lukastaegert deleted the no-inlined-attributes branch April 7, 2024 07:21
Copy link

github-actions bot commented Apr 7, 2024

This PR has been released as part of rollup@4.14.1. You can test it via npm install rollup.

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.

None yet

1 participant