Hacker News new | ask | show | jobs
by agentcooper 663 days ago
I wonder if you can get better performance than the built-in browser engine for certain complex layouts by first calculating the layout using Clay and then absolutely positioning the elements with HTML/CSS.

There was some news feed web app that used <canvas /> for better scrolling performance.

1 comments

if you can guarantee that layouts don't change during interactions, i guess it _might_ save some time for the browser (and thus battery, for low power devices).

If layouts change during interaction (e.g., orientation swap), then you will have a roundtrip to the server to recalculate. I assume this would cost more time than letting the browser css engine do their thing.

In my comment I assumed that Clay layout is running in the browser as well, but your idea of running it before serving the HTML is quite interesting!
I wonder if this would be more efficient than the browser's impl. But i guess if clay does less complex layouts (but which is still sufficient for applications) than css, it might be faster than the browser's own.

Very curious train of thought.

Very interesting indeed, score one more for server side generation.