-
Notifications
You must be signed in to change notification settings - Fork 87
CanonicalizedMap
: added constructor fromEntries
.
#347
CanonicalizedMap
: added constructor fromEntries
.
#347
Conversation
FYI: @kevmoo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it! Any notes @devoncarew @natebosch ?
@gmpassos – LOVE THIS work. We're looking at a few other PRs and should have this published on Monday. I'll let you follow-up with the |
Once this reaches pub.dev I will push a PR on 'http_parser', then one on 'shelf'. It's all about the tests and merge "ping pong" delay. @kevmoo, Best regards. |
About the performance improvement: I'm conducting many benchmarks using our own API (real-world) code. One bottleneck is the handling of case-insensitive headers. We will continue to check for other "hotspots" once the new fixes are in production. |
Revisions updated by `dart tools/rev_sdk_deps.dart`. collection (https://github.com/dart-lang/collection/compare/586a5e8..141d83a): 141d83a 2024-06-07 Graciliano Monteiro Passos `CanonicalizedMap`: added constructor `fromEntries`. (dart-archive/collection#347) convert (https://github.com/dart-lang/convert/compare/302af1b..70940e3): 70940e3 2024-06-10 Alex Li ⚡ Upper-cast the return type of the decoder (dart-archive/convert#99) dartdoc (https://github.com/dart-lang/dartdoc/compare/ddb8fb4..3decf1e): 3decf1ed 2024-06-07 Sam Rawlins Restrict validation of runtime renderer files to a single, target version of (dart-lang/dartdoc#3778) ecosystem (https://github.com/dart-lang/ecosystem/compare/bc25c0c..865b2c5): 865b2c5 2024-06-07 Devon Carew update docs and metadata for package:sdk_triage_bot (dart-lang/ecosystem#266) 268b516 2024-06-06 Devon Carew initial version of a sdk issue triage bot (dart-lang/ecosystem#264) http (https://github.com/dart-lang/http/compare/a3567f8..b522000): b522000 2024-06-08 Anikate De fix inconsistent test server behavior (dart-lang/http#1227) mime (https://github.com/dart-lang/mime/compare/8d2d559..4ca2f5e): 4ca2f5e 2024-06-10 Sarah Zakarias Add `topics` to `pubspec.yaml` (dart-archive/mime#126) Change-Id: I6b6279a4ff0af5ba19cc3c4180389b949f48d623 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370660 Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Devon Carew <devoncarew@google.com>
https://pub.dev/packages/collection/versions/1.19.0 – this is published @gmpassos ! What's next? Here to help! |
|
Currently, the only way to create a
CanonicalizedMap
is from a fully constructedMap
.With
fromEntries
, a common use case, we can avoid the creation of an intermediateMap
.Real-world case:
Avoid unnecessary overhead as seen here:
https://github.com/dart-lang/shelf/blob/master/pkgs/shelf/lib/src/headers.dart#L32
https://github.com/dart-lang/http_parser/blob/master/lib/src/case_insensitive_map.dart#L13
Reason:
Improve Dart benchmark performance:
https://sharkbench.dev/web