Closed gmpassos closed 3 months ago
FYI: @kevmoo
I made some tweaks.
nice
@gmpassos – and some more tweaks 😄
@gmpassos – do you have benchmarks showing this makes things notably faster?
@gmpassos – we need to roll this through our internal "stuff" before we publish. To make sure nothing breaks. I'll let you know when publish happens!
@gmpassos – we need to roll this through our internal "stuff" before we publish. To make sure nothing breaks. I'll let you know when publish happens!
Thanks for the quick response and attention. I will wait for the publication...
Looks like @devoncarew landed in the Dart SDK 50 minutes ago. We'll have to wait a few hours to make sure that rolls into our internal...things...before we publish
@gmpassos – do you have benchmarks showing this makes things notably faster?
In my benchmark, I get a 1-2% improvement, but note that you need to have real-world headers (real browsers send many more headers than simple HTTP clients). Additionally, you need a heavy load, as this also affects the GC. This is more significant for slower/smaller servers. On a medium-sized server with low traffic, this won't have much impact.
I'm also looking for a way to avoid computation of all canonicalized keys just to build the headers. This will significantly improve performance, or we could use a specialized cache of canonicalized keys, but this will be a future optimization.
shelf published w/ this! @gmpassos !
Headers
:Headers.fromEntries
._fromEntries
, which usesCaseInsensitiveMap.fromEntries
for optimization._
to_from
, redirecting it tothis._fromEntries
.