-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
absurdly slow operations on deeply nested pairs #30476
Comments
I ran some profiling for this particular example. Here is the (very large) result of |
You can use the |
Note that the same thing happens with tuples, e.g. if |
For reference, on 0.6 I get
and on 0.5
|
To confirm @ararslan 's comment that it doesn't happen only with
exhibits the same problem (and I get a timing even worst than for |
I noticed while testing #30471 that printing deeply nested
Pair
types seems absurdly slow. In Julia 1.0, I get:Almost a minute and over a million allocations to print a 150-character string doesn't seem right.
In contrast,
mapfoldl(abs, Pair{Any,Any}, -50:-1)
prints instantly, and similarly for callingprintln(p)
a second time above, so the problem must have to do with compiling lots of code specialized for the different nestedPair
types above.It might be fixed by adding
@nospecialize
to theshow
function forPair
, but I wonder if there is a deeper problem & solution for nested parameterized types.The text was updated successfully, but these errors were encountered: