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

Refactor AST converters #5544

Merged
merged 5 commits into from
Jun 23, 2024
Merged

Refactor AST converters #5544

merged 5 commits into from
Jun 23, 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

This does two things:

  • If possible, the conversion of fields is inlined into the AST object creation for bufferToAst.ts. While I do not expect this to be a performance improvement, this will make it easier to build a lazy AST generator on top of this
  • The "readString" argument is removed. Instead, convertString is added as a method on the buffer, making things somewhat nicer.

Copy link

vercel bot commented Jun 9, 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 Jun 23, 2024 9:33am

Copy link

github-actions bot commented Jun 9, 2024

Thank you for your contribution! ❤️

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

npm install rollup/rollup#refactor-converters

Notice: Ensure you have installed the latest stable Rust toolchain. If you haven't installed it yet, please see https://www.rust-lang.org/tools/install to learn how to download Rustup and install Rust.

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

Copy link

github-actions bot commented Jun 9, 2024

Performance report!

Rough benchmark

Command Mean [s] Min [s] Max [s] Relative
node _benchmark/previous/bin/rollup -i ./perf/entry.js -o _benchmark/result/previous.js 10.262 ± 0.071 10.182 10.317 1.00
node _benchmark/current/bin/rollup -i ./perf/entry.js -o _benchmark/result/current.js 10.264 ± 0.079 10.193 10.349 1.00 ± 0.01

Internal benchmark

  • BUILD: 9169ms, 752 MB
    • initialize: 0ms, 26 MB
    • generate module graph: 3404ms, 575 MB
      • generate ast: 1613ms, 568 MB
    • sort and bind modules: 529ms, 615 MB
    • mark included statements: 5222ms, 752 MB
      • treeshaking pass 1: 1694ms, 717 MB
      • treeshaking pass 2: 834ms, 741 MB
      • treeshaking pass 3: 342ms, 747 MB
      • treeshaking pass 4: 320ms, 743 MB
      • treeshaking pass 5: 365ms, 751 MB
      • treeshaking pass 6: 307ms, 751 MB
      • treeshaking pass 7: 288ms, 748 MB
      • treeshaking pass 8: 277ms, 751 MB
      • treeshaking pass 9: 259ms, 754 MB
      • treeshaking pass 10: 259ms, 756 MB
      • treeshaking pass 11: 254ms, 752 MB
  • GENERATE: 1019ms, 1.02 GB
    • initialize render: 0ms, 914 MB
    • generate chunks: 92ms, 925 MB
      • optimize chunks: 0ms, 916 MB
    • render chunks: 895ms, 1 GB
    • transform chunks: 22ms, 1.02 GB
    • generate bundle: 0ms, 1.02 GB

Copy link

codecov bot commented Jun 9, 2024

Codecov Report

Attention: Patch coverage is 97.47899% with 6 lines in your changes missing coverage. Please review.

Project coverage is 99.04%. Comparing base (655ce78) to head (0a55c50).

Files Patch % Lines
src/ast/bufferParsers.ts 97.74% 0 Missing and 3 partials ⚠️
src/utils/bufferToAst.ts 96.66% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5544      +/-   ##
==========================================
- Coverage   99.07%   99.04%   -0.03%     
==========================================
  Files         238      238              
  Lines        9544     9248     -296     
  Branches     2437     2437              
==========================================
- Hits         9456     9160     -296     
  Misses         58       58              
  Partials       30       30              

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

@lukastaegert lukastaegert force-pushed the refactor-converters branch from eebb146 to 0a55c50 Compare June 23, 2024 09:31
@lukastaegert lukastaegert merged commit 1c1587e into master Jun 23, 2024
37 of 39 checks passed
@lukastaegert lukastaegert deleted the refactor-converters branch June 23, 2024 16:52
Copy link

github-actions bot commented Jul 8, 2024

This PR has been released as part of rollup@4.18.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.

1 participant