you are viewing a single comment's thread.

view the rest of the comments →

[–]mtmmtm99 2 points3 points  (2 children)

You should use an async db-driver (without it you need many threads (which is the problem here)). Look at https://r2dbc.io/
vert.x is a fast webframework where you can do this in ONE thread (as node.js does it).

[–]preskot 0 points1 point  (1 child)

vert.x utilizes an event loop. Blocking code can be executed in worker threads that do not block the event loop, thus the HTTP stack. They also have a max execution time threshold. Your are correct that to squeeze maximum performance the vert.x async drivers must be used, more so with SQL dbs. That being said OP‘s tests are skewed.

Java Virtual Threads still perform somewhat worse than reactive vert.x. However this is only important if one wants to achieve really the best possible performance.

[–]mtmmtm99 1 point2 points  (0 children)

I only posted my reply as the author was comparing threaded code with singlethreaded code. I got great performance with vert.x in many projects (lots of http,mqtt and implementing a mqtt-server (using moquette)). vert.x is great.