-
Notifications
You must be signed in to change notification settings - Fork 47
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
The handling of edge labels is sometimes very slow #500
Comments
Two suggestions:
In my above 5 minute example, I never care at all about the edge labels, so it is disappointing that that is what is slowly it down so very much. |
Ahh, the checking of If I get rid of both the check for
Only checking for
Not checking for
Therefore, about half of the time is spent checking for Therefore both of these things should be improved. Why is the check for |
Stale issue message |
I'm just observing this now too in an example I am trying to run, I think we need something like |
Ah wait this already exists and is called |
UPDATE: Although in #509 I have resolved the specific problem highlighted in this issue, there are still ideas in this issue thread that I think should be addressed. Namely, other operations may have similar problems, and moreover, having to exclude multidigraphs is currently a massive time sink, and should be mitigated as much as possible.
In my opinion, adding edges to a digraph one-by-one is too slow (even to a mutable digraph, which we are starting to do more often, especially with our standard examples; this was even the point of adding mutable digraphs).
For example, let's use this method to try to construct a chain digraph with only 100,000 vertices and therefore 99,999 edges:
Nearly 5 minutes is way too long! By contrast, doing this with the
ChainDigraph
function takes very little time:When I interrupt the slow computation, I always get a backtrace that looks like this, so I presume that the slow part of adding the edge is the accounting to do with edge labels:
Therefore I think we need a better implementation of edge labels!
Anyway, in this example, I have never explicitly given this digraph any edge labels, so it is frustrating that the package is spending so long worrying about keeping track of the information that every edge has label 1.
The text was updated successfully, but these errors were encountered: