Rendering in batches with glimmer and Datastar

8 points by Yogthos


andersmurphy

Always fun to see remixes of my half formed ideas. Even more so when it's from one of my heroes!

I remember reading Web Development with Clojure, back when it was luminus and thinking where is Clojurescript, where is react? Funny, how we're back to simple server side rendering covered in your book.

I read through your commits. The patching part is interesting, my problem with it is you still end up doing full renders most of the time, and pay for the dirty tracking. I've found a fast equality check on a light skeleton (so that it doesn't take much space in memory) of the previous frame gets you most of the way there (short circuits). As this basically skips frames that haven't changed. If you keep the equality cheap (1-2% CPU time on flamegraphs) i.e you have a slim view on components with equality on args and opaque (so there’s less to walk).

https://github.com/andersmurphy/hyperlith/blob/17c7bae261eadb8d912fb11d7b0ac82b884ce365/src/hyperlith/impl/html.clj#L40

https://github.com/andersmurphy/hyperlith/blob/17c7bae261eadb8d912fb11d7b0ac82b884ce365/src/hyperlith/impl/datastar.clj#L146

I would stress that zstd for streaming is night and day compared to gzip. Even a 128kb context window makes a massive difference (often orders of magnitude, both in CPU and bandwidth). It's in the linux kernel so most systems have it.

Yogthos

As a meta observation, it's pretty depressing how toxic Lobsters is becoming now with people marking posts as spam in passive aggressive fashion.

subnut

Unless I'm mistaken, this was authored by the same person as the submitter, and should be marked as such.