312 karma · joined July 10, 2022
michael@electricui.com
Originally this post was much longer, but I've split it into two, and I'll release the second part once it's finished soon (hopefully in a couple of days).
This was sparked by Preact Signals monkey patching the renderer in their React package. I thought that such a high maintenance cost decision surely conferred huge performance benefits, when in fact it does not! Though I don't show it in this specific benchmark (it's in the next post), it's more performant to subscribe to the signal and update a regular useState hook in the component, no monkey patching required.
I think it's helpful to see that these text updates are taking on the order of <20 microseconds on 10 year old hardware, so upending your entire state management solution in pursuit of better performance might not be a sound compromise.