9 ms·
Not that I think those metrics are all that relevant, but can someone explain to me how just-js ranks so highly? Very much defying my expectations in comparison
by 41b696ef1113 4y ago
Not that I think those metrics are all that relevant, but can someone explain to me how just-js ranks so highly? Very much defying my expectations in comparison with some of the top representatives of compiled languages.
- jeroenhd 4y agoI honestly don't know. It could be a consequence of the way the test is set up, or how the total score is calculated, or maybe the code was optimized better than other frameworks were. You read see the source of the tests here: https://github.com/TechEmpower/FrameworkBenchmarks/tree/master/frameworks/JavaScript/just https://github.com/TechEmpower/FrameworkBenchmarks/tree/mast... The SQL code seems quite optimized (manually compiling database packets instead of using a library). Most code seems quite static and very small, so it's probably very quick. I don't think you can actually use the framework like that in practice, though.
- tempest_ 4y agoA huge amount of time and money has been spent making JS as fast as it can be. Additionally a lot of these benchmarks focus on things that the JS engines are very good at. It isnt like they are running CPU intensive tasks in JS.
- NavinF 4y agoNot sure, but it’s pretty funny how the most popular frameworks (rails, Django, flask, laravel, etc) are way at the bottom with 3% the score of the winner. Apparently async db requests and batching transactions are the key to winning on that benchmark: https://news.ycombinator.com/item?id=24315512 https://news.ycombinator.com/item?id=24315512 I wish more benchmarks would produce latency vs requests/second curves in microseconds. I bet the latency is massive due to batching.
- ipaddr 4y agoThere fortune test is weight 1.5 while others are weighted at 1 or .75.
- ibraheemdev 4y agoIf you look at the techempower submission source code you'll quickly see why: https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/JavaScript/just/lib/connection.js https://github.com/TechEmpower/FrameworkBenchmarks/blob/mast....
- dralley 4y agoI so deeply wish for a set of benchmarks that accepted only idiomatic, standard code that a slightly above average developer would plausibly write. Pretty much every set of benchmarks out there is ruined by monstrous unrealistic code that squeezes out 5% more performance than actually well written code. As a side note, one flaw of TechEmpower benchmarks is that to my knowledge they use the original "wrk" tool, which only supports HTTP 1.0 and is sensitive to "coordinated omission" [0]. This means it ends up being biased in favor of web frameworks that implement specific optimizations or have specific behaviors that aren't actually useful in a production context. [0] https://github.com/giltene/wrk2 https://github.com/giltene/wrk2
- igouy 4y agoPlease explain how we are to practically identify "idiomatic, standard code that a slightly above average developer would plausibly write." Or is it some Goldilocks not-unoptimised not-too-optimised I'll-know-it-when-I-see-it wishful-thinking thing?
- ______-_-______ 4y agoThose benchmarks are pretty heavily gamed. Think about things like hardcoding "Content-Length: 123" instead of computing the length at runtime.
- staticassertion 4y agoThe code used for it looks like someone ran a compiler over it and then dumped the output lol it's... extremely hard to read.
- cfu28 4y agoThe author of just-js did a write up about how he got that performance: https://just.billywhizz.io/blog/on-javascript-performance-01/ https://just.billywhizz.io/blog/on-javascript-performance-01...