krausest / js-framework-benchmark

A comparison of the performance of a few popular javascript frameworks
https://krausest.github.io/js-framework-benchmark/
Apache License 2.0
6.58k stars 814 forks source link

add htmx and astro for the benchmark ? #1604

Closed TheElegantCoding closed 3 months ago

TheElegantCoding commented 4 months ago

htmx is no a framework is a library and requires in some cases more tools to works, but right now is been using a lot, so i think there should be a benchmark for this with astro or other combinations of tools, this tools are almost as vanilla js

krausest commented 4 months ago

From what I understand htmx is all about ajax requests and then updating (a part of) the page from the response. (I'm ignoring client side scripting since that would just converge with vanillajs). I can't imagine that this kind of interaction can be reasonably measured with this benchmark. Imagine select row: The measurement would include the ajax call and the swapping of the selected row. Other frameworks manage to just patch the css class for the selected row. That comparison wouldn't make much sense IMHO and wouldn't show the benefits of htmx.

ukazap commented 4 months ago

Can we make the overhead from AJAX calls slightly irrelevant, say, by using Service Worker to mock a server that spits out html?

krausest commented 4 months ago

Maybe, but I think it misses the point of that benchmark. This benchmark is focused on frameworks with a client side model. You change the model (create, delete, select rows) and the DOM gets magically updated. The benchmarks measures the efficiency of that update and applies a note if it's not real magic. I think it doesn't match htmx's update strategy. How would you create the following operations?

Unless I'm mistaken with the assumptions above this would be very inefficient for delete row and would get note #772 for select row. The implementation would be non-keyed if implemented as described above.