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(minifier): dereference SymbolId as soon as possible #6823

Conversation

overlookmotel
Copy link
Contributor

@overlookmotel overlookmotel commented Oct 23, 2024

Style nit. Dereference &SymbolId to SymbolId as early as possible. &SymbolId is 8 bytes, whereas SymbolId is 4 bytes.

In simple cases like these, compiler will optimize it anyway, but still I think it's a better pattern to dererence early. In more complicated cases, it will be better for performance, and in my opinion, it makes things clearer if vars called symbol_id are always a SymbolId, and not sometimes a &SymbolId.

Copy link

graphite-app bot commented Oct 23, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @overlookmotel and the rest of your teammates on Graphite Graphite

@github-actions github-actions bot added the C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior label Oct 23, 2024
@overlookmotel overlookmotel marked this pull request as ready for review October 23, 2024 12:56
@overlookmotel
Copy link
Contributor Author

Small style nit, so merging without review.

@overlookmotel overlookmotel added 0-merge Merge with Graphite Merge Queue A-minifier Area - Minifier labels Oct 23, 2024
Copy link
Contributor Author

overlookmotel commented Oct 23, 2024

Merge activity

  • Oct 23, 8:57 AM EDT: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Oct 23, 9:00 AM EDT: A user added this pull request to the Graphite merge queue.
  • Oct 23, 9:17 AM EDT: A user merged this pull request with the Graphite merge queue.

Style nit. Dereference `&SymbolId` to `SymbolId` as early as possible. `&SymbolId` is 8 bytes, whereas `SymbolId` is 4 bytes.

In simple cases like these, compiler will optimize it anyway, but still I think it's a better pattern to dererence early. In more complicated cases, it will be better for performance, and in my opinion, it makes things clearer if vars called `symbol_id` are always a `SymbolId`, and not sometimes a `&SymbolId`.
@overlookmotel overlookmotel force-pushed the 10-23-refactor_minifier_dereference_symbolid_as_soon_as_possible branch from 3c2e554 to e59b5d9 Compare October 23, 2024 13:03
@graphite-app graphite-app bot merged commit e59b5d9 into main Oct 23, 2024
24 checks passed
@graphite-app graphite-app bot deleted the 10-23-refactor_minifier_dereference_symbolid_as_soon_as_possible branch October 23, 2024 13:17
Copy link

codspeed-hq bot commented Oct 23, 2024

CodSpeed Performance Report

Merging #6823 will not alter performance

Comparing 10-23-refactor_minifier_dereference_symbolid_as_soon_as_possible (e59b5d9) with main (a148023)

Summary

✅ 30 untouched benchmarks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0-merge Merge with Graphite Merge Queue A-minifier Area - Minifier C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant