-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use values
iterator and update
in map equality/hash
#718
Conversation
Package publishing
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
PR HealthBreaking changes ✔️
Changelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. Coverage ✔️
This check for test coverage is informational (issues shown here will not fail the PR). API leaks ✔️The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
License Headers ✔️
All source files should start with a license header. |
entries
and update
for equality in map equality/hash impls.values
iterator and update
for equality in map equality/hash
values
iterator and update
for equality in map equality/hashvalues
iterator and update
in map equality/hash
cc @davidmorgan |
Revisions updated by `dart tools/rev_sdk_deps.dart`. core (https://github.com/dart-lang/core/compare/4b62792..1156cfe): 1156cfe4 2024-11-06 Jacob MacDonald Use `values` iterator and `update` in map equality/hash (dart-lang/core#718) 9ab5a189 2024-11-05 Jacob MacDonald add a basic benchmark for DeepCollectionEquality (dart-lang/core#717) 9e379158 2024-11-05 Jonas Finnemann Jensen Introduce `IterableMapEntryExtension` for use with `Map.entries`. (dart-lang/core#715) dartdoc (https://github.com/dart-lang/dartdoc/compare/5168f81..24c2a96): 24c2a966 2024-11-04 dependabot[bot] Bump the github-actions group across 1 directory with 4 updates (dart-lang/dartdoc#3922) http (https://github.com/dart-lang/http/compare/8db0d0a..03ced4d): 03ced4d 2024-11-06 Brian Quinlan Upgrade flutter_http_example to cupertino_http (dart-lang/http#1393) df59bac 2024-11-05 Brian Quinlan Release package:cupertino_http 2.0.1 (dart-lang/http#1400) 0544e1f 2024-11-05 Brian Quinlan Fix a bug where cupertino_http did not work on iOS<17. (dart-lang/http#1399) sse (https://github.com/dart-lang/sse/compare/1b02011..befbd6d): befbd6d 2024-11-04 dependabot[bot] Bump actions/checkout from 4.2.0 to 4.2.2 in the github-actions group (dart-lang/sse#118) Change-Id: I2b4ebfe2f56f9478c7e89cd2d3e50485ae44caa0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393943 Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Devon Carew <devoncarew@google.com> Auto-Submit: Devon Carew <devoncarew@google.com>
Initially I tried using
entries
instead of avalues
iterator, but that was surprisingly slow. This appears to be a good middle ground (see history of this comment for old results).Hashing is about the same, but much faster for maps which don't have O(1) lookup. Equality is much faster.
Benchmarks before:
DeepCollectionQualityUnordered.equals(RunTime): 7427.29020979021 us.
DeepCollectionQualityUnordered.hash(RunTime): 217.8173707406213 us.
DeepCollectionQuality.equals(RunTime): 2653.23875 us.
DeepCollectionQuality.hash(RunTime): 178.1674653887114 us.
Benchmarks after:
DeepCollectionQualityUnordered.equals(RunTime): 4435.374 us.
DeepCollectionQualityUnordered.hash(RunTime): 212.8631545473818 us.
DeepCollectionQuality.equals(RunTime): 1989.1746626686656 us.
DeepCollectionQuality.hash(RunTime): 178.3396697902722 us.