mayu-live / framework

Mayu is a live updating server-side component-based VDOM rendering framework written in Ruby
https://mayu.live
GNU Affero General Public License v3.0
130 stars 4 forks source link

Two way diff #53

Closed aalin closed 1 year ago

aalin commented 1 year ago

Add the famous two way diff used in many other VDOM implementations.

basic benchmarks with random orders:

old implementation (ms)

500 inserts: 14.782000064849854 500 shuffle: 71.27499997615814 shuffle and remove 300: 19.103000044822693

new implementation (ms)

500 inserts: 7.65500009059906 500 shuffle: 18.229999899864197 shuffle and remove 300: 4.972000002861023