luwes / js-diff-benchmark

Simple benchmark for testing your DOM diffing algorithm.
66 stars 5 forks source link

Make the benchmark more focused on the diffing part #11

Closed WebReflection closed 4 years ago

WebReflection commented 4 years ago

The udomdiff get(node, operation) has no meaning in here, but it also has no meaning for most other libraries, as the get is currently a no-op. The operation is also not always reflected elsewhere, and there are libraries not using the get(node) at all, or using a createFn instead, which is not what get is about, in udomdiff. Accordingly, get could penalize both size and performance, so I've decided to remove it completely from the equation, making the benchmark more fair across implementations.

WebReflection commented 4 years ago

Results

 HECKEL 449B 

create 1000: 1.322ms
operations 1000 

random: 5.746ms
operations 2000 +1000 

reverse: 3.751ms
operations 2000 +1000 

clear: 1.559ms
operations 1000 

replace 1000: 8.208ms
operations 2000 

append 1000: 13.268ms
operations 3000 +2000 

append more: 28.403ms
operations 5000 +4000 

swap rows: 5.993ms
operations 2000 +1998 

update every 10th row: 6.707ms
operations 2000 +1800 

create 10000 rows: 107.463ms
operations 10000 

swap over 10000 rows: 193.566ms
operations 20000 +19998 

clear 10000: 102.148ms
operations 10000 

HECKEL: 515.586ms
The script uses approximately 17.72 MB

*******************************************

 STAGE0 941B 

create 1000: 1.071ms
operations 1000 

random: 10.476ms
operations 936 

reverse: 5.761ms
operations 1000 

clear: 1.141ms
operations 1000 

replace 1000: 6.791ms
operations 2000 

append 1000: 5.642ms
operations 1000 

append more: 8.233ms
operations 1000 

swap rows: 1.504ms
operations 2 

update every 10th row: 2.243ms
operations 200 

create 10000 rows: 102.39ms
operations 10000 

swap over 10000 rows: 47.551ms
operations 2 

clear 10000: 141.779ms
operations 10000 

STAGE0: 384.475ms
The script uses approximately 17.01 MB

*******************************************

 LIST-DIFFERENCE 271B 

create 1000: 1.798ms
operations 1000 

random: 6.479ms
operations 986 

reverse: 4.265ms
operations 999 

clear: 1.459ms
operations 1000 

replace 1000: 7.031ms
operations 2000 

append 1000: 2.802ms
operations 1000 

append more: 6.736ms
operations 1000 

swap rows: 7.065ms
operations 997 +995 

update every 10th row: 0.841ms
operations 200 

create 10000 rows: 104.454ms
operations 10000 

swap over 10000 rows: 44.616ms
operations 997 +995 

clear 10000: 98.917ms
operations 10000 

LIST-DIFFERENCE: 317.069ms
The script uses approximately 20.31 MB

*******************************************

 SNABBDOM 412B 

create 1000: 0.788ms
operations 1000 

random: 7.35ms
operations 990 

reverse: 8.663ms
operations 999 

clear: 0.865ms
operations 1000 

replace 1000: 2.754ms
operations 2000 

append 1000: 4.522ms
operations 1000 

append more: 7.591ms
operations 1000 

swap rows: 0.043ms
operations 2 

update every 10th row: 2.869ms
operations 200 

create 10000 rows: 111.14ms
operations 10000 

swap over 10000 rows: 0.232ms
operations 2 

clear 10000: 102.188ms
operations 10000 

SNABBDOM: 285.85ms
The script uses approximately 18.8 MB

*******************************************

 UDOMDIFF 397B 

create 1000: 0.83ms
operations 1000 

random: 4.099ms
operations 1640 +640 

reverse: 6.444ms
operations 1000 

clear: 2.567ms
operations 1000 

replace 1000: 4.354ms
operations 2000 

append 1000: 5.417ms
operations 1000 

append more: 7.073ms
operations 1000 

swap rows: 0.037ms
operations 2 

update every 10th row: 1.483ms
operations 200 

create 10000 rows: 106.236ms
operations 10000 

swap over 10000 rows: 0.198ms
operations 2 

clear 10000: 101.597ms
operations 10000 

UDOMDIFF: 264.712ms
The script uses approximately 19.43 MB

*******************************************

 SPECT 297B 

create 1000: 1.106ms
operations 1000 

random: 9.442ms
operations 999 

reverse: 10.714ms
operations 1000 

clear: 2.863ms
operations 1000 

replace 1000: 2.76ms
operations 2001 +1 

append 1000: 11.146ms
operations 1000 

append more: 6.665ms
operations 1000 

swap rows: 0.156ms
operations 5 +3 

update every 10th row: 0.758ms
operations 201 +1 

create 10000 rows: 102.132ms
operations 10000 

swap over 10000 rows: 1.832ms
operations 5 +3 

clear 10000: 103.141ms
operations 10000 

SPECT: 283.375ms
The script uses approximately 19.07 MB

*******************************************
WebReflection commented 4 years ago

P.S. I've updated the README to reflect the new sizes, but I haven't touched the results in ms, as it's clear my laptop has different results and see udomdiff constantly ~20ms faster than the next one, so I'll let you eventually run these again and update the table, if needed.