- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
objectid takes arbitrarily long #43542
Comments
This is definitely a pathological case --- conceptually there is a tree of size 2^N, but because of shared references there are only N objects, so it feels like it should be possible to traverse. I guess we would need to add some memoization to fix this, but I'm not sure that's worthwhile since it will add overhead. |
Pardon me, I was under the impression that |
I think it would be worthwhile to add a simple memoization dict. We probably have all of the needed pieces (with the ptrhash htable) to implement this fairly easily in the objectid code in jl_object_id in src/builtins.c, if anyone wanted to tackle it. |
@vtjnash If this issue is still open, I would like to work on it please |
Go for it |
@vtjnash if I'm right, the memoization dict would be used in this case to store pointers to each |
The computation happens in |
@vtjnash, if I'm not wrong, the |
Yes, those are the functions you would need to change. Then rebuild ( |
In the following code, I construct a large deeply nested DAG and then call
objectid
on the root node. I'm expecting this to be instant, but instead the call toobjectid
takes time proportional to the size of the data structure. With the size 100 used below it probably won't return ever.Version info:
The text was updated successfully, but these errors were encountered: