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

perf: reduce allocation for Stats #7124

Merged
merged 3 commits into from
Jul 18, 2024
Merged

perf: reduce allocation for Stats #7124

merged 3 commits into from
Jul 18, 2024

Conversation

h-a-n-a
Copy link
Collaborator

@h-a-n-a h-a-n-a commented Jul 11, 2024

Summary

Construct JsStats like data structs with more &'static str.
Allocate less for core Stats like data structs.

Previously:

  • Identifier: Identifier -> String (allocation +1) -> napi_create_string_utf8 (allocation +1)

Currently:

  • &'static str: &'static str -> napi_create_string_utf8 (allocation +1)
  • Identifier: Identifier -> &'static str -> napi_create_string_utf8 (allocation +1)

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@github-actions github-actions bot added team The issue/pr is created by the member of Rspack. release: performance release: performance related release(mr only) labels Jul 11, 2024
Copy link

netlify bot commented Jul 11, 2024

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 672fd1b
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/66988fcd8ea1400008dfff00

@h-a-n-a

This comment was marked as outdated.

@rspack-bot

This comment was marked as outdated.

@h-a-n-a h-a-n-a changed the title perf: reduce Stats alloc perf: reduce allocation for Stats Jul 18, 2024
@h-a-n-a h-a-n-a marked this pull request as ready for review July 18, 2024 04:44
@h-a-n-a h-a-n-a enabled auto-merge (squash) July 18, 2024 04:45
@h-a-n-a h-a-n-a merged commit 32888e1 into main Jul 18, 2024
36 checks passed
@h-a-n-a h-a-n-a deleted the perf-stats-alloc branch July 18, 2024 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: performance release: performance related release(mr only) team The issue/pr is created by the member of Rspack.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants