undici icon indicating copy to clipboard operation
undici copied to clipboard

Benchmarks and Optimizations

Open metcoder95 opened this issue 11 months ago • 0 comments

Discussed in https://github.com/nodejs/undici/discussions/2891

Originally posted by metcoder95 February 29, 2024 Hey! 👋

Wanted to open a discussion just to get your thoughts on this as I have been thinking about this topic for a while.

I've seen recently quite a few PRs for doing optimizations over fetch especially, and I believe and appreciate all of them as it's super helpful to have people contributing to those ends. Highly appreciated.

Nevertheless, I'm starting to see a pattern of constant micro-optimizations (sometimes companioned by micro-benchmarks) that focus on pretty specific parts of the whole flow on fetch that often than not might not make a big impact if we take a holistic view over the fetch implementation (e.g. cold-paths, use cases that are not often seen, etc.).

I believe that those contributions can be of even greater value if we shift that focus to the holistic view of fetch and how the numbers change based on the changes proposed and if they are of impact or not, as it will help assess the value of the change as well as what other parts we can shift our focus to make fetch faster (or even undici).

For instance we can focus on having a better benchmark setup for fetch only, its Web APIs (e.g. Cookies, CacheStorage, WebSocket, etc.).

Feel free to discard the idea, or maybe propose something different 🙂

I'll try to draft something later this week, but any suggestion is welcomed

metcoder95 avatar Mar 06 '24 09:03 metcoder95