Skip to content
This repository was archived by the owner on May 24, 2023. It is now read-only.

Use HashMap, HashSet from dart:collection – faster! #25

Closed
kevmoo opened this issue Nov 5, 2018 · 2 comments
Closed

Use HashMap, HashSet from dart:collection – faster! #25

kevmoo opened this issue Nov 5, 2018 · 2 comments
Assignees

Comments

@kevmoo
Copy link
Contributor

kevmoo commented Nov 5, 2018

https://github.com/dart-lang/graphs/blob/d329d755cae8ce5c472842ec51ff2229ee8c481b/lib/src/strongly_connected_components.dart#L29

If you don't care about insertion ordering, you'll get better perf and mem usage if you use the Hash* flavor

@kevmoo
Copy link
Contributor Author

kevmoo commented Nov 5, 2018

In the case I just looked at, I can run the connected components logic ~3200 times in one second w/ Hash* over ~2700 times per second w/ LinkedHash*

@kevmoo
Copy link
Contributor Author

kevmoo commented Nov 5, 2018

FYI: this is VM, not dart2js

kevmoo added a commit that referenced this issue Nov 5, 2018
Looks like ~10% improvement with dart2js and a ~8% improvement on VM

Fixes #25
@kevmoo kevmoo assigned kevmoo and unassigned natebosch Nov 5, 2018
@kevmoo kevmoo closed this as completed in #26 Nov 5, 2018
kevmoo added a commit that referenced this issue Nov 5, 2018
Looks like ~10% improvement with dart2js and a ~8% improvement on VM

Fixes #25
dcharkes pushed a commit to dart-lang/tools that referenced this issue May 23, 2023
Looks like ~10% improvement with dart2js and a ~8% improvement on VM

Fixes dart-archive/graphs#25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants