chinedufn / percy

Build frontend browser apps with Rust + WebAssembly. Supports server side rendering.
https://chinedufn.github.io/percy/
Apache License 2.0
2.27k stars 84 forks source link

UTF16 Text #75

Open dbrgn opened 5 years ago

dbrgn commented 5 years ago

JavaScript uses UTF16-encoding for strings, while Rust uses UTF8.

The value of VirtualNode::Text is String, so for every DOM update the text needs to be re-encoded.

I wonder if it might make sense to have a VirtualNode::TextUtf16(Vec<u16>) variant for when you already deal with UTF16 text internally? Might give some performance benefits, although I'm not sure how much.

chinedufn commented 5 years ago

So one thing that I'd like to have ~eventually is benchmarking in real browsers.

The main thing that I was thinking about on the benchmarking front was the diff/patch algorithm .. but something like this would be good also!

dbrgn commented 5 years ago

Yep, I agree. Performance optimizations without benchmarking are worthless.