79225847

Date: 2024-11-26 08:23:16
Score: 1
Natty:
Report link

I think I know what's wrong with your tests and results. You're testing Javascript Fetch performance through the browser, but all of the browsers have very limited number of concurrent connections available to them - most of them have just 6, some older ones have only 2, and the most connections available is 8 in Firefox IIRC. Anyways,

your javascript fetches actually are fired in parallel so all but first 6 get queued in the browser's connection pool and enqueue time can be very high (relative to the response time of your fetches).

your Python's fetches do not have this limitation and hence perceived to be so much faster.

for more fair comparison I'd suggest to use node.js for example, create some route.js that'd get a request and multiplex it in parallel there using fetch.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Eugene Sytnik