WebAssembly / stringref

Other
37 stars 2 forks source link

Performance report for kotlin wasm compiler #57

Open igoriakovlev opened 1 year ago

igoriakovlev commented 1 year ago

Hi, We have some stringref experiment results concerning stringref proposal.

We compared two different string implementations using chars array and stringref reference implementations. We rewritten dom-monster the benchmark (which using DOM a lot) from JS into the Kotlin and compiled it into the Wasm with and w/o stringref support. The results were measured with two ways: DevTools framerate stats and perf-monitor (that was applied only to DOM updating part of benchmark code).

We got next results:

The profile we got for classic string implementation shows that at least 10% of all CPU time was spent for Kotlin to JS conversions.

ecmziegler commented 1 year ago

These are very encouraging numbers! Can you explain in a little more detail how those three data points compare against each other?

Thank you!

igoriakovlev commented 1 year ago

Hi @ecmziegler

I can share with you instructions how to reproduce this benchmark if you would like to dive into it.

Igor

Pauan commented 1 year ago

@igoriakovlev I don't really know how DOM update works in Chrome (is it updates and render updated DOM immediately or postpone it somehow).

All browsers delay updates until the next animation frame (or if you use certain APIs, like clientWidth or getBoundingClientRect).

This means that the browser batches multiple updates together, and the actual DOM updating is delayed until later.