-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
Open
Labels
Description
The current implementation of the req.accepts, req.acceptsEncodings, and req.acceptsEncoding methods in lib/request.js creates a new accepts instance for each call.
Am I correct to think that this can lead to redundant object creation and parsing overhead, especially in scenarios where these methods are called multiple times within the same request lifecycle?
If caching the accepts instance seems correct to reduce overhead and help with faster execution, I am willing to create PR and benchmark comparisons for this. However, since I have very little idea about the overall scenario I need a confirmation of go / no go.
bjohansebas and ifty64bit