Original (but outdated) issue description
I have a medium-sized project (5k LOC) and noticed that, since #894 was merged, some revisions cause Revise to lock up (I'm not sure if it will terminate eventually because I've terminated it after 5min). In my project, I can most reliably trigger this situation by changing some default values in a `@kwdef` struct, e.g., changing
Base.@kwdef struct Foo
a::Int = 1
end
to
Base.@kwdef struct Foo
a::Int = 2
end
Unfortunately, this change in isolation does not trigger the issue and I have yet to find a good way to isolate a compact MWE. Still, I thought it's worth opening this issue in case others observe similar issues or have ideas for how to narrow this down.
Updated Issue Description
I have a medium-sized project and noticed that, since #894 was merged, revisions cause Revise to take very long. My project itself has only about 5k LOC but it has a few heavy dependencies (including CUDA and Plots.jl). I added some logging to Revise (see #988 (comment)) and found that collect_all_subtypes(Any) reaches 62k subtypes (almost all of which are from dependencies). Indexing those takes about 16min.
Looking at those logs, it looks like the initial cache that is built on the background thread hits only about 13k types (because it is loaded before everything else). Upon the first change to any code, we hit collect_all_subtypes(Any) again which now has to index another ~49k subtypes reachable through the newly loaded (transient) dependencies.
So, in sum, this slowness seems to be the compounding effect of three issues:
- Changes of default arguments in
@kwdef trigger struct revision (not just traditional non-struct revision)
alltypes gets way too large (perhaps because it also includes all subtypes of Function)
- The initial call to
collect_all_subtypes hits only a small portion of the type tree because is typically loaded before everything else
Original (but outdated) issue description
I have a medium-sized project (5k LOC) and noticed that, since #894 was merged, some revisions cause Revise to lock up (I'm not sure if it will terminate eventually because I've terminated it after 5min). In my project, I can most reliably trigger this situation by changing some default values in a `@kwdef` struct, e.g., changingto
Unfortunately, this change in isolation does not trigger the issue and I have yet to find a good way to isolate a compact MWE. Still, I thought it's worth opening this issue in case others observe similar issues or have ideas for how to narrow this down.
Updated Issue Description
I have a medium-sized project and noticed that, since #894 was merged, revisions cause Revise to take very long. My project itself has only about 5k LOC but it has a few heavy dependencies (including CUDA and Plots.jl). I added some logging to Revise (see #988 (comment)) and found that
collect_all_subtypes(Any)reaches 62k subtypes (almost all of which are from dependencies). Indexing those takes about 16min.Looking at those logs, it looks like the initial cache that is built on the background thread hits only about 13k types (because it is loaded before everything else). Upon the first change to any code, we hit
collect_all_subtypes(Any)again which now has to index another ~49k subtypes reachable through the newly loaded (transient) dependencies.So, in sum, this slowness seems to be the compounding effect of three issues:
@kwdeftrigger struct revision (not just traditional non-struct revision)alltypesgets way too large (perhaps because it also includes all subtypes ofFunction)collect_all_subtypeshits only a small portion of the type tree because is typically loaded before everything else