-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
perf: created NULL constant #4682
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
📊 Tachometer Benchmark ResultsSummaryduration
usedJSHeapSize
Resultscreate10kduration
usedJSHeapSize
filter-listduration
usedJSHeapSize
hydrate1kduration
usedJSHeapSize
many-updatesduration
usedJSHeapSize
replace1kduration
usedJSHeapSize
run-warmup-0
run-warmup-1
run-warmup-2
run-warmup-3
run-warmup-4
run-final
text-updateduration
usedJSHeapSize
tododuration
usedJSHeapSize
update10th1kduration
usedJSHeapSize
|
rschristian
approved these changes
Feb 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice golfing!
Size Change: -56 B (-0.07%)
Total Size: 78.3 kB
Filename | Size | Change |
---|---|---|
dist/preact.min.js |
4.71 kB | -14 B (-0.3%) |
dist/preact.min.umd.js |
4.74 kB | -14 B (-0.29%) |
dist/preact.umd.js |
4.74 kB | -28 B (-0.59%) |
ℹ️ View Unchanged
Filename | Size |
---|---|
compat/dist/compat.js |
4.12 kB |
compat/dist/compat.mjs |
4.05 kB |
compat/dist/compat.module.js |
4.05 kB |
compat/dist/compat.umd.js |
4.19 kB |
debug/dist/debug.js |
3.83 kB |
debug/dist/debug.mjs |
3.83 kB |
debug/dist/debug.module.js |
3.83 kB |
debug/dist/debug.umd.js |
3.91 kB |
devtools/dist/devtools.js |
260 B |
devtools/dist/devtools.mjs |
274 B |
devtools/dist/devtools.module.js |
274 B |
devtools/dist/devtools.umd.js |
346 B |
dist/preact.js |
4.71 kB |
dist/preact.min.module.js |
4.73 kB |
dist/preact.mjs |
4.72 kB |
dist/preact.module.js |
4.72 kB |
hooks/dist/hooks.js |
1.54 kB |
hooks/dist/hooks.mjs |
1.57 kB |
hooks/dist/hooks.module.js |
1.57 kB |
hooks/dist/hooks.umd.js |
1.61 kB |
jsx-runtime/dist/jsxRuntime.js |
978 B |
jsx-runtime/dist/jsxRuntime.mjs |
952 B |
jsx-runtime/dist/jsxRuntime.module.js |
952 B |
jsx-runtime/dist/jsxRuntime.umd.js |
1.05 kB |
test-utils/dist/testUtils.js |
473 B |
test-utils/dist/testUtils.mjs |
477 B |
test-utils/dist/testUtils.module.js |
477 B |
test-utils/dist/testUtils.umd.js |
555 B |
I wouldn't pay much mind to the .min
builds, I don't think they've ever been set up right.
Merged
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Slightly reduced output size by creating a constant for null (
NULL
), so that the bunder can reduce the size of null uses. This is similar to the existingUNDEFINED
constant.Also something I noticed was that in the module build, both the
NULL
andUNDEFINED
constants are outlined. This isn't the same in the UMD buid, where they are properly substitued for variables.You can quickly test this by loking for
null
orvoid 0
literals in the output, forpreact.min.js
andpreact.min.umd.js
there's only 2 instances, but forpreact.min.module.js
there's 97. I'm not sure what's causing this behaviour, whether if it's a correctness thing or just a weird build result.