SaltyAom / bun-http-framework-benchmark

Compare throughput benchmark from various Bun HTTP framework
349 stars 30 forks source link

Run over network or localhost? #72

Open taylordwright44 opened 3 weeks ago

taylordwright44 commented 3 weeks ago

I was wondering if these results were ran over network or localhost. I was looking at the benchmark for hyper-express and it specifically states you should run it over Network, which is how it would be ran in the real world anyways.

From Hyper-Express: Note! these benchmarks should be run over network for proper results as running these benchmarks on localhost significantly strains the C++ to Javascript communications and class initializations performance due to near no latency in request times which is unrealistic for real world scenarios.

https://github.com/kartikk221/hyper-express/blob/master/docs/Benchmarks.md

I assume that applies to ALL of the uwebsocket.js based http servers and not just their's. Interestingly in their results hyper-express is only slightly behind uwebsockets.js. Also someone in another issue mentioned the results are different from Windows to Linux, and Hyper-Express's benchmark was done from Linux which makes up an estimated 80% of web servers. I assume doing it their way would be far more accurate to real world standards, over a network and on Linux.

taylordwright44 commented 3 weeks ago

@kartikk221

kartikk221 commented 3 weeks ago

Hello, yes with localhost it is possible to strain the Node to C++ overhead due to the fast volume and little queueing or delay in the localhost communication.

The best results are seen by using a small payload size and then ideally testing over network between two machines.