Skip to content

Comments

chore(common): rm useless mutable#10405

Merged
kdy1 merged 1 commit intoswc-project:mainfrom
bvanjoi:pref-3
Apr 30, 2025
Merged

chore(common): rm useless mutable#10405
kdy1 merged 1 commit intoswc-project:mainfrom
bvanjoi:pref-3

Conversation

@bvanjoi
Copy link
Contributor

@bvanjoi bvanjoi commented Apr 24, 2025

No description provided.

@bvanjoi bvanjoi requested a review from a team as a code owner April 24, 2025 04:49
@changeset-bot
Copy link

changeset-bot bot commented Apr 24, 2025

⚠️ No Changeset found

Latest commit: e315a9a

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

@codspeed-hq
Copy link

codspeed-hq bot commented Apr 24, 2025

CodSpeed Performance Report

Merging #10405 will degrade performances by 2.4%

Comparing bvanjoi:pref-3 (e315a9a) with main (a0e89f0)

Summary

⚡ 1 improvements
❌ 1 regressions
✅ 150 untouched benchmarks

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

Benchmarks breakdown

Benchmark BASE HEAD Change
deserialization of serde 2.4 µs 2.4 µs -2.4%
serialization of serde 2.8 µs 2.7 µs +3.28%

@@ -293,7 +293,7 @@ pub trait Input: Clone {
/// `c` must be ASCII.
#[inline]
#[allow(clippy::wrong_self_convention)]
Copy link
Contributor

Choose a reason for hiding this comment

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

That clippy warning is probably gone as well then.

Suggested change
#[allow(clippy::wrong_self_convention)]

Copy link
Member

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

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

I'll merge this when I'm going to make a breaking change of swc_common

@bvanjoi
Copy link
Contributor Author

bvanjoi commented Apr 24, 2025

COMMENT: The reason I’d like to merge this PR since it shows a slight performance improvement in this report. However, I’m not entirely sure whether this is just noise or an actual improvement from these changes.

@kdy1
Copy link
Member

kdy1 commented Apr 24, 2025

I know, and it's expected to be faster because &mut is (very slightly) slower than &. Compiler cannot move in-between &mut-s, so & is likely to be faster.

But the problem is that this is a breaking change of swc_common meaning that nearly all SWC crates have to be published

@kdy1 kdy1 added this to the Planned milestone Apr 30, 2025
@kdy1 kdy1 merged commit edbeb49 into swc-project:main Apr 30, 2025
168 checks passed
@kdy1 kdy1 modified the milestones: Planned, v1.11.25 May 3, 2025
@swc-project swc-project locked as resolved and limited conversation to collaborators Jun 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants