Skip to content

chore: add span of module_request in raw import record#1871

Merged
IWANABETHATGUY merged 4 commits intomainfrom
chore/add-import-module-request-span
Aug 5, 2024
Merged

chore: add span of module_request in raw import record#1871
IWANABETHATGUY merged 4 commits intomainfrom
chore/add-import-module-request-span

Conversation

@IWANABETHATGUY
Copy link
Copy Markdown
Member

@IWANABETHATGUY IWANABETHATGUY commented Aug 5, 2024

Description

  1. This pr add the ability to get the span of module_request.
  2. Aiming to keep the type size unchanged, I did some refactors, If I add Span directly the type size will increase from 40 to 48 bytes.

Related to #1866

@netlify
Copy link
Copy Markdown

netlify bot commented Aug 5, 2024

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit b3cde79
🔍 Latest deploy log https://app.netlify.com/sites/rolldown-rs/deploys/66b0fc1a1d61f90008baecf7

/// See [ImportRecord] for more details.
pub is_plain_import: bool,
pub module_request_start: u32,
pub import_record_meta: ImportRecordMeta,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub import_record_meta: ImportRecordMeta,
pub meta: ImportRecordMeta,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you think this might cause confusing with considering the meta word used in link stage. You could call it flags too.

pub contains_import_default: bool,
/// If it is `import {} from '...'` or `import '...'`
pub is_plain_import: bool,
pub meta: ImportRecordMeta,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Span in ImportRecord is unused, so I don't pass it into ImportRecord

@IWANABETHATGUY IWANABETHATGUY marked this pull request as ready for review August 5, 2024 16:07
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Aug 5, 2024

Benchmarks Rust

  • target: main(a18a8da)
  • pr: chore/add-import-module-request-span(b3cde79)
group                                                               pr                                     target
-----                                                               --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol                     1.00     52.3±1.03ms        ? ?/sec    1.03     54.0±0.89ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-minify              1.00     68.8±0.86ms        ? ?/sec    1.03     70.8±1.13ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-minify-sourcemap    1.00     85.0±1.60ms        ? ?/sec    1.05     88.9±1.12ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap           1.00     61.6±1.50ms        ? ?/sec    1.07     65.8±2.45ms        ? ?/sec
bundle/bundle@rome-ts                                               1.00     93.9±1.71ms        ? ?/sec    1.01     94.6±1.45ms        ? ?/sec
bundle/bundle@rome-ts-minify                                        1.00    156.0±2.03ms        ? ?/sec    1.02    158.9±1.88ms        ? ?/sec
bundle/bundle@rome-ts-minify-sourcemap                              1.00    201.1±1.58ms        ? ?/sec    1.00    200.3±2.35ms        ? ?/sec
bundle/bundle@rome-ts-sourcemap                                     1.01    114.2±1.81ms        ? ?/sec    1.00    113.2±1.18ms        ? ?/sec
bundle/bundle@threejs                                               1.00     28.1±0.73ms        ? ?/sec    1.03     29.0±0.94ms        ? ?/sec
bundle/bundle@threejs-minify                                        1.00     64.8±2.44ms        ? ?/sec    1.02     65.8±3.20ms        ? ?/sec
bundle/bundle@threejs-minify-sourcemap                              1.04     87.2±1.34ms        ? ?/sec    1.00     84.0±1.72ms        ? ?/sec
bundle/bundle@threejs-sourcemap                                     1.02     41.7±2.49ms        ? ?/sec    1.00     40.8±0.53ms        ? ?/sec
bundle/bundle@threejs10x                                            1.00    307.0±4.12ms        ? ?/sec    1.00    307.0±2.90ms        ? ?/sec
bundle/bundle@threejs10x-minify                                     1.00    683.1±9.28ms        ? ?/sec    1.02    695.8±6.25ms        ? ?/sec
bundle/bundle@threejs10x-minify-sourcemap                           1.00    905.2±9.96ms        ? ?/sec    1.02    923.1±6.87ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                                  1.01    405.2±8.87ms        ? ?/sec    1.00    399.6±5.87ms        ? ?/sec
remapping/remapping                                                 1.00     34.7±0.48ms        ? ?/sec    1.01     35.0±0.13ms        ? ?/sec
remapping/render-chunk-remapping                                    1.00     81.3±0.41ms        ? ?/sec    1.00     81.5±0.84ms        ? ?/sec
scan/scan@rome-ts                                                   1.04     74.0±1.63ms        ? ?/sec    1.00     71.4±0.93ms        ? ?/sec
scan/scan@threejs                                                   1.00     20.3±0.28ms        ? ?/sec    1.00     20.3±0.33ms        ? ?/sec
scan/scan@threejs10x                                                1.02    203.4±1.53ms        ? ?/sec    1.00    200.4±1.57ms        ? ?/sec

@IWANABETHATGUY IWANABETHATGUY added this pull request to the merge queue Aug 5, 2024
Merged via the queue into main with commit ad78e63 Aug 5, 2024
@IWANABETHATGUY IWANABETHATGUY deleted the chore/add-import-module-request-span branch August 5, 2024 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants