Improve API call latency #28
jpbourgeon
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
node-fetch
references no dependency toundici
in itspackage.json
. AFAIKundici
powers thefetch
feature ofnode.js >= 18.x
but is not related tonode-fetch
. Did you confusednode-fetch
withnode.js
?If we do it well, we wouldn't be tied to
node.js
. To me being able to useitty-aws
in other runtime context is tied to our architecturing choices. This is why I suggest adopting an adapter/middleware architecture in another discussion. We could then have alternative implementation of common interfaces from any environment and inject any flavour of external dependency needed to make it work.This benchmark compares
node-fetch
toundici
, and although it is a bit old, it shows thatundici fetch
outperformsnode-fetch
even with a custom HTTP agent. Furthermore, there are alternatives to fetch in theundici
API that need to be explored, since they are way faster than their ownfetch
method (see their internal benchmark):stream
,dispatch
,request
orpipeline
.Beta Was this translation helpful? Give feedback.
All reactions