-
Notifications
You must be signed in to change notification settings - Fork 54
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 bulk IntMap operations #40
Conversation
Use `Data.IntMap.differenceWith` to implement `(&)` and `match` for `Data.Graph.Inductive.PatriciaTree`. Instead of modifying the graph manually, one key at a time, `differenceWith` will efficiently partition the set of keys to be modified along the structure of the graph. This should be considerably more efficient when inserting or matching on well-connected nodes. Fixes haskell#39
We may want to change this a bit, actually. I started to make the change, then got confused and stopped. The |
Hmm.... Actually, I'm not sure if it's worth trying to specialize for the poorly-connected case. Do you have any benchmarks that this PR could be run against? |
Unfortunately, it seems we do have to worry about the poorly-connected case; the benchmarks show a regression. I'm working on it. It's not so clear to me just what the benchmarked graphs tend to look like; that might be nice to document. |
Let me take that back again! The benchmark change must have been some insignificant artifact, because the benchmarks don't actually touch any of that code. We definitely need more benchmarks! |
Yes, benchmarks are solely lacking. Alas, I have little excuses to do graph Haskell usage at work (as the few times I thought it may have been relevant for some data processing it ended up running for so long that I killed it as it looked untenable) so I don't have any ready made large-scale graph examples to use :/ |
Another little issue is that the benchmark framework is ancient and weird. On Tue, Aug 30, 2016 at 7:35 PM, Ivan Lazar Miljenovic <
|
Definitely; I just hadn't gotten around to doing new benchmarks yet. |
Use
Data.IntMap.differenceWith
to implement(&)
andmatch
for
Data.Graph.Inductive.PatriciaTree
. Instead of modifyingthe graph manually, one key at a time,
differenceWith
willefficiently partition the set of keys to be modified along the
structure of the graph. This should be considerably more efficient
when inserting or matching on well-connected nodes.
Fixes #39