Optimize newInnerRequest blob url check

perf(fetch): optimize newInnerRequest blob url check (#12245)
Optimize newInnerRequest blob url checkperfoptimize newinnerrequest blob url check fetch

Committed by AaronO

commit message
perf(fetch): optimize newInnerRequest blob url check (#12245)

Avoid "blob:" prefix check on requests built in the http module since those can never be blob objects
 
Reduces cost of `newInnerRequest()` from 20ms to 0.1ms in my profiled run on ~2.5M reqs

Editor assessment

The subject names the optimized check exactly: the blob url test in newInnerRequest. The body earns a top mark twice over: it explains why the check is safe to skip (requests built in the http module can never be blobs) and quantifies the result (20ms to 0.1ms on a profiled 2.5M-request run). Safety reasoning plus measurement is exemplary perf communication. Type perf and scope fetch are accurate, and hygiene is clean. An instructive, verifiable message.

Browse categories

More perf examples · Back to search