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

only deduplicate non-primitives #44

Merged
merged 1 commit into from
Nov 1, 2022
Merged

Conversation

Rich-Harris
Copy link
Owner

Currently, all values are deduplicated, meaning that input like [null, null] will result in this output:

(function(a){return [a,a]}(null))

In very simple cases like the one above, this creates overhead. In very complex cases, it can result in an IIFE with too many function arguments (sveltejs/kit#6672). With this change, it would still be possible to reach that threshold, but it's far less likely.

In some cases this will result in larger payloads, but gzip/brotli compression will take care of it in all the places that it matters.

@Rich-Harris Rich-Harris merged commit bd87340 into master Nov 1, 2022
@Rich-Harris Rich-Harris deleted the duplicate-primitives branch November 1, 2022 20:50
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.

1 participant