Indeed, sql query batching is the key (and I personally think that the techempower website should make it explicit), async communication with the db and the http client is also the key.
FYI lithium is not using a libpq fork from 2016, it has been rebased on master 1 month ago. but yes Lithium (the sql-pipeline branch) is using it. (I mailed the drogon maintainer to update it aswell).
About H2O, the non batched version of lithium is as fast (slighly faster on some tests, slighly slower on others), while being much simpler to use (implementation of TFB of H20 is 4400 lines vs 250 lines for lithium...)
Interesting, thanks for the answer.
What I would really like to see is the obligation to have in the name "Lithium-with_batch" and a version "Lithium" that would be without it. It would show the impact of other optimizations which are currently hidden by the paradigm shift.
I added -pipeline but I guess -with-batch is more explicit. I'll change it then. But anyway the techempower team will eventually add a special tag for batching. There is actually a version of lithium not using batching, check for 'lithium-postgres' in the benchmark tabs other than 'composite score'
Other big optimizations are
- non blocking communications between the database and the framework
- non blocking communication between the http client and the framework
This is for C++, for other slower interpreted languages: calling C bindings is a big optimization aswell (and this is how some php frameworks get good performances for example).
Thanks. Asynchronocity is one thing but there is one thing that in theory can achieve better performance than asynchronicity alone: I'm referring to the reactive programming paradigm which benefit from the concept of backpressure.
If you've heard of it, do you think it could achieve even better performance?
https://medium.com/@jayphelps/backpressure-explained-the-flo...
I had a look at the video, but I don't think there is backpresure in this benchmark since there is only 512 connections max and each connections wait for the server response before sending a new request. So in other words the load generator never send more request/s that the server is able to handle. (tell me if I missunderstood backpressure)
Mmh then I wonder if the techempowerUp benchmark suite would benefit from a new benchmarck that is backpressure sensitive, thus increasing its coverage of real world workloads?
yes, it has been discused already to increase the number of connections. But still, several thousands of simultaneous connections is still ok for the best performing frameworks...
FYI lithium is not using a libpq fork from 2016, it has been rebased on master 1 month ago. but yes Lithium (the sql-pipeline branch) is using it. (I mailed the drogon maintainer to update it aswell).
About H2O, the non batched version of lithium is as fast (slighly faster on some tests, slighly slower on others), while being much simpler to use (implementation of TFB of H20 is 4400 lines vs 250 lines for lithium...)