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

Fix hash collision in generated variable names #7017

Merged
merged 2 commits into from
Oct 5, 2021
Merged

Conversation

devongovett
Copy link
Member

Fixes #6708.

JsWord is derived from the string-cache crate. This implements the hash method, and in some cases uses a very poor hash function. This replaces that by writing the actual string bytes to the hasher instead.

@height
Copy link

height bot commented Oct 5, 2021

Link Height tasks by mentioning a task ID in the pull request title or description, commit messages, or comments.

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

@parcel-benchmark
Copy link

parcel-benchmark commented Oct 5, 2021

Benchmark Results

Kitchen Sink ✅

Timings

Description Time Difference
Cold 2.37s +39.00ms
Cached 345.00ms -2.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

React HackerNews ✅

Timings

Description Time Difference
Cold 10.96s -1.21s 🚀
Cached 500.00ms -71.00ms 🚀

Cold Bundles

Bundle Size Difference Time Difference
dist/index.js 487.00kb +0.00b 5.94s -481.00ms 🚀
dist/PermalinkedComment.e846300d.js 4.20kb +0.00b 5.93s -481.00ms 🚀
dist/UserProfile.a136423a.js 1.57kb +0.00b 5.93s -482.00ms 🚀
dist/NotFound.a7537975.js 429.00b +0.00b 5.93s -482.00ms 🚀
dist/logo.c5bb83f1.png 246.00b +0.00b 5.89s -498.00ms 🚀

Cached Bundles

Bundle Size Difference Time Difference
dist/index.js 487.00kb +0.00b 5.80s -463.00ms 🚀
dist/PermalinkedComment.e846300d.js 4.20kb +0.00b 5.80s -464.00ms 🚀
dist/UserProfile.a136423a.js 1.57kb +0.00b 5.80s -464.00ms 🚀
dist/NotFound.a7537975.js 429.00b +0.00b 5.80s -463.00ms 🚀
dist/logo.c5bb83f1.png 246.00b +0.00b 5.75s -461.00ms 🚀

AtlasKit Editor ✅

Timings

Description Time Difference
Cold 1.21m +53.00ms
Cached 1.91s +81.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/index.6e27519f.js 1.78mb -1.00b 🚀 21.24s +770.00ms
dist/index.543acb98.js 694.70kb +15.00b ⚠️ 55.66s +340.00ms

Cached Bundles

Bundle Size Difference Time Difference
dist/index.a86a72f2.js 1.78mb +6.00b ⚠️ 20.65s -409.00ms
dist/index.5afe9f27.js 694.70kb +19.00b ⚠️ 54.29s -1.53s

Three.js ✅

Timings

Description Time Difference
Cold 8.06s -123.00ms
Cached 457.00ms +2.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

Click here to view a detailed benchmark overview.

@devongovett devongovett merged commit 5c20290 into v2 Oct 5, 2021
@devongovett devongovett deleted the hash-collision branch October 5, 2021 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Same hash generated for two different functions with similar names
3 participants