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(hstr): Skip interning if the text is long enough #10035

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

kdy1
Copy link
Member

@kdy1 kdy1 commented Feb 14, 2025

Description:

Almost all long strings are likely to differ, so there's no worth interning them. Those are mostly template literals in the case of SWC, but I didn't see any instance of very long text being identical to other instances.

Related issue:

@kdy1 kdy1 added this to the Planned milestone Feb 14, 2025
@kdy1 kdy1 self-assigned this Feb 14, 2025
Copy link

changeset-bot bot commented Feb 14, 2025

⚠️ No Changeset found

Latest commit: f7f6c81

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@kdy1 kdy1 marked this pull request as ready for review February 14, 2025 03:40
@kdy1 kdy1 requested a review from a team as a code owner February 14, 2025 03:40
@kdy1 kdy1 enabled auto-merge (squash) February 14, 2025 03:41
@kdy1 kdy1 disabled auto-merge February 14, 2025 03:49
@kdy1 kdy1 merged commit 2622e4e into swc-project:main Feb 14, 2025
169 checks passed
@kdy1 kdy1 deleted the hstr2 branch February 14, 2025 03:49
Copy link

codspeed-hq bot commented Feb 14, 2025

CodSpeed Performance Report

Merging #10035 will degrade performances by 6.44%

Comparing kdy1:hstr2 (f7f6c81) with main (2bea793)

Summary

⚡ 4 improvements
❌ 1 regressions
✅ 191 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
es/full/minify/libraries/vue 236 ms 226.3 ms +4.29%
es/full/parser 1.4 ms 1.4 ms +4.02%
es/minifier/libs/jquery 128.2 ms 137 ms -6.44%
es/minifier/libs/lodash 155 ms 146.9 ms +5.51%
es/minifier/libs/vue 190.7 ms 182.9 ms +4.25%

@kdy1 kdy1 modified the milestones: Planned, v1.10.17 Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

hstr: Avoid interning for large strings (probability issue)
1 participant