Reduce core bundle size in v11#5167
Open
JoviDeCroock wants to merge 4 commits into
Open
Conversation
📊 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
|
|
Size Change: -39 B (-0.25%) Total Size: 15.7 kB 📦 View Changed
ℹ️ View Unchanged
|
Simplify core control flow and reuse existing constants to reduce the production bundle from 4,857 to 4,814 bytes gzip while preserving behavior.
Keep createElement and cloneElement normalization together and reuse their argument counts. This reduces core from 4,814 to 4,804 bytes gzip without adding runtime work.
Restore the existing isValidElement declaration and remove the obsolete cloneElement re-export module. This leaves core at 4,806 bytes gzip while narrowing source churn.
- Guard the oldChildren lookup with ~_index: a negative array index is a named property access which V8 can't serve from the fast elements path, this made every mounted child pay a dictionary lookup. - Compare remainingOldChildren against (matched ? 1 : 0) instead of the boolean so the comparison stays on the Smi fast path.
JoviDeCroock
force-pushed
the
JoviDeCroock/reduce-core-bundle-size
branch
from
July 22, 2026 06:43
b45e121 to
0d68f5c
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in 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.
cloneElementwithcreateElementbenefits gzip with 8 bytes