Skip to content

Commit 71da453

Browse files
committed
Get away from KeySet solution
1 parent 9a220c2 commit 71da453

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

blog/2020/05/invalidations.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,8 +584,9 @@ immediately after the `for` statement to fix the problem.
584584
Not only does this fix the invalidation, but it lets the compiler generate better code.
585585

586586
The other case was a call from `Pkg` of `keys` on an AbstractDict of unknown type
587-
(due to partial specialization).
588-
Replacing `keys(dct)` with `Base.KeySet(dct)` (which is the default return value of `keys`) eliminated a very consequential invalidation, one that triggered seconds-long latencies in the next `Pkg` command after loading Revise.
587+
(due to inference failure).
588+
Resolving that inference problem eliminated a very consequential invalidation, one that triggered seconds-long latencies in the next `Pkg` command after loading Revise.
589+
589590
The benefits of this change in Pkg's code went far beyond helping Revise; any package depending on the OrderedCollections package (which is a dependency of Revise and what actually triggered the invalidation) got the same benefit.
590591
With these and a few other relatively simple changes, loading Revise no longer forces Julia to recompile much of Pkg's code the next time you try to update packages.
591592

0 commit comments

Comments
 (0)