Content pfp
Content
@
0 reply
0 recast
2 reactions

jtgi pfp
jtgi
@jtgi
surprising 10x speed up in throughput with this change: Before: - await promise 1 - await p2 - await p3 - await p4 After: - await [p1, p2] - await [p3, p4] Running node.js. Expected minor speed up. Underestimated cost of context switching.
10 replies
2 recasts
26 reactions

Kevin pfp
Kevin
@typedarray.eth
Desperate for more details, pls
1 reply
0 recast
0 reaction

jtgi pfp
jtgi
@jtgi
Was that simple; diff below. context: this is a standard http request handler, does about 1rps. The subroutines here are not expensive. I was expecting a minor speed up in proportion to request duration but median request went from ~1500ms to ~70ms. https://gist.github.com/jtgi/a9d9694186360df255481466fd19fac8
2 replies
0 recast
1 reaction