Skip to content

refactor(children): remove redundant assignment to childVNode#4951

Merged
JoviDeCroock merged 2 commits intopreactjs:mainfrom
ali-garajian:main
Oct 31, 2025
Merged

refactor(children): remove redundant assignment to childVNode#4951
JoviDeCroock merged 2 commits intopreactjs:mainfrom
ali-garajian:main

Conversation

@ali-garajian
Copy link
Contributor

No description provided.

@github-actions
Copy link

github-actions bot commented Oct 31, 2025

📊 Tachometer Benchmark Results

Summary

duration

  • create10k: unsure 🔍 -1% - +0% (-5.62ms - +3.69ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -0% - +0% (-0.04ms - +0.03ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -1% - +3% (-0.66ms - +2.30ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -1% - +4% (-0.22ms - +0.65ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -0% - +2% (-0.10ms - +1.47ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -5% - +4% (-0.10ms - +0.08ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -1% - +1% (-0.23ms - +0.22ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -4% - +4% (-1.07ms - +1.18ms)
    preact-local vs preact-main

usedJSHeapSize

  • create10k: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -1% - +1% (-0.01ms - +0.01ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -5% - +8% (-0.32ms - +0.50ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -0% - +0% (-0.00ms - +0.01ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -3% - +3% (-0.03ms - +0.03ms)
    preact-local vs preact-main
  • todo: unsure 🔍 +0% - +0% (+0.00ms - +0.00ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -0% - +0% (-0.00ms - +0.01ms)
    preact-local vs preact-main

Results

create10k

duration

VersionAvg timevs preact-localvs preact-main
preact-local979.85ms - 985.67ms-unsure 🔍
-1% - +0%
-5.62ms - +3.69ms
preact-main980.10ms - 987.36msunsure 🔍
-0% - +1%
-3.69ms - +5.62ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local19.04ms - 19.04ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main19.04ms - 19.04msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
filter-list

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.54ms - 16.58ms-unsure 🔍
-0% - +0%
-0.04ms - +0.03ms
preact-main16.54ms - 16.59msunsure 🔍
-0% - +0%
-0.03ms - +0.04ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.54ms - 1.55ms-unsure 🔍
-1% - +1%
-0.01ms - +0.01ms
preact-main1.54ms - 1.55msunsure 🔍
-1% - +1%
-0.01ms - +0.01ms
-
hydrate1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local70.95ms - 73.02ms-unsure 🔍
-1% - +3%
-0.66ms - +2.30ms
preact-main70.11ms - 72.22msunsure 🔍
-3% - +1%
-2.30ms - +0.66ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local6.16ms - 6.75ms-unsure 🔍
-5% - +8%
-0.32ms - +0.50ms
preact-main6.09ms - 6.65msunsure 🔍
-8% - +5%
-0.50ms - +0.32ms
-
many-updates

duration

VersionAvg timevs preact-localvs preact-main
preact-local15.99ms - 16.79ms-unsure 🔍
-1% - +4%
-0.22ms - +0.65ms
preact-main16.01ms - 16.35msunsure 🔍
-4% - +1%
-0.65ms - +0.22ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.73ms - 3.73ms-unsure 🔍
-0% - +0%
-0.00ms - +0.01ms
preact-main3.72ms - 3.73msunsure 🔍
-0% - +0%
-0.01ms - +0.00ms
-
replace1k
  • Browser: chrome-headless
  • Sample size: 100
  • Built by: CI #5202
  • Commit: b26b4de

duration

VersionAvg timevs preact-localvs preact-main
preact-local59.02ms - 60.30ms-unsure 🔍
-0% - +2%
-0.10ms - +1.47ms
preact-main58.53ms - 59.43msunsure 🔍
-2% - +0%
-1.47ms - +0.10ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local2.99ms - 2.99ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main2.99ms - 2.99msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-

run-warmup-0

VersionAvg timevs preact-localvs preact-main
preact-local24.53ms - 25.20ms-unsure 🔍
-3% - +1%
-0.65ms - +0.34ms
preact-main24.66ms - 25.39msunsure 🔍
-1% - +3%
-0.34ms - +0.65ms
-

run-warmup-1

VersionAvg timevs preact-localvs preact-main
preact-local30.57ms - 31.52ms-unsure 🔍
-4% - +0%
-1.40ms - +0.01ms
preact-main31.21ms - 32.27msunsure 🔍
-0% - +5%
-0.01ms - +1.40ms
-

run-warmup-2

VersionAvg timevs preact-localvs preact-main
preact-local30.27ms - 30.96ms-unsure 🔍
-1% - +2%
-0.36ms - +0.58ms
preact-main30.19ms - 30.83msunsure 🔍
-2% - +1%
-0.58ms - +0.36ms
-

run-warmup-3

VersionAvg timevs preact-localvs preact-main
preact-local23.58ms - 23.85ms-unsure 🔍
-1% - +1%
-0.27ms - +0.13ms
preact-main23.64ms - 23.93msunsure 🔍
-1% - +1%
-0.13ms - +0.27ms
-

run-warmup-4

VersionAvg timevs preact-localvs preact-main
preact-local25.15ms - 26.63ms-unsure 🔍
-3% - +5%
-0.82ms - +1.30ms
preact-main24.89ms - 26.41msunsure 🔍
-5% - +3%
-1.30ms - +0.82ms
-

run-final

VersionAvg timevs preact-localvs preact-main
preact-local19.89ms - 20.65ms-unsure 🔍
-0% - +5%
+0.00ms - +0.91ms
preact-main19.58ms - 20.05msfaster ✔
0% - 4%
0.00ms - 0.91ms
-
text-update
  • Browser: chrome-headless
  • Sample size: 120
  • Built by: CI #5202
  • Commit: b26b4de

duration

VersionAvg timevs preact-localvs preact-main
preact-local2.07ms - 2.19ms-unsure 🔍
-5% - +4%
-0.10ms - +0.08ms
preact-main2.07ms - 2.20msunsure 🔍
-4% - +5%
-0.08ms - +0.10ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local0.98ms - 1.03ms-unsure 🔍
-3% - +3%
-0.03ms - +0.03ms
preact-main0.98ms - 1.02msunsure 🔍
-3% - +3%
-0.03ms - +0.03ms
-
todo

duration

VersionAvg timevs preact-localvs preact-main
preact-local31.05ms - 31.32ms-unsure 🔍
-1% - +1%
-0.23ms - +0.22ms
preact-main31.01ms - 31.37msunsure 🔍
-1% - +1%
-0.22ms - +0.23ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.26ms - 1.26ms-unsure 🔍
+0% - +0%
+0.00ms - +0.00ms
preact-main1.26ms - 1.26msunsure 🔍
-0% - -0%
-0.00ms - -0.00ms
-
update10th1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local27.73ms - 29.35ms-unsure 🔍
-4% - +4%
-1.07ms - +1.18ms
preact-main27.70ms - 29.27msunsure 🔍
-4% - +4%
-1.18ms - +1.07ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local2.94ms - 2.95ms-unsure 🔍
-0% - +0%
-0.00ms - +0.01ms
preact-main2.94ms - 2.95msunsure 🔍
-0% - +0%
-0.01ms - +0.00ms
-

tachometer-reporter-action v2 for CI

@coveralls
Copy link

coveralls commented Oct 31, 2025

Coverage Status

coverage: 99.442%. remained the same
when pulling b26b4de on ali-garajian:main
into 5bea6be on preactjs:main.

Copy link
Member

@JoviDeCroock JoviDeCroock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great find! Looks like it saves 2 bytes, thank you for cleaning this up and contributing! If you want you can also backport this to v10.x which I intend to draft a release for this weekend

@JoviDeCroock JoviDeCroock merged commit 84c10e4 into preactjs:main Oct 31, 2025
13 checks passed
Copy link
Member

@rschristian rschristian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Byte diff comes from the second commit, somehow the first has no effect? Wonder if terser is stripping that for us or if compression is really just a marvel

Good catch tho!

JoviDeCroock pushed a commit that referenced this pull request Nov 29, 2025
* refactor(children): remove redundant assignment to childVNode

* refactor(children): use key instead of childVNode.key

---------

Co-authored-by: Ali Garajian <ali.garajian@snapppay.ir>
JoviDeCroock added a commit that referenced this pull request Nov 29, 2025
* refactor(children): remove redundant assignment to childVNode (#4951)

* refactor(children): remove redundant assignment to childVNode

* refactor(children): use key instead of childVNode.key

---------

Co-authored-by: Ali Garajian <ali.garajian@snapppay.ir>

* refactor(diff): no need to reset props and context when creating component (#4954)

* refactor(children): remove redundant assignment to childVNode

* refactor(children): use key instead of childVNode.key

* refactor(diff): no need to reset props and context when creating component

---------

Co-authored-by: Ali Garajian <ali.garajian@snapppay.ir>

* refactor(children): remove redundant assignment to oldVNode (#4956)

Co-authored-by: Ali Garajian <ali.garajian@snapppay.ir>

* refactor(diff): set oldProps default value on declaration (#4959)

---------

Co-authored-by: Ali Garajian <50337133+ali-garajian@users.noreply.github.com>
Co-authored-by: Ali Garajian <ali.garajian@snapppay.ir>
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.

4 participants