forked from rails/rails
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Iterating initializers for each node child is expensive. Instead, we can use a hash to speed up tsorting children to iterate less often. This can save a lot of time on larger apps: Before: ``` Warming up -------------------------------------- tsort initializers 24.000 i/100ms Calculating ------------------------------------- tsort initializers 244.212 (± 2.5%) i/s (4.09 ms/i) - 1.224k in 5.015190s ``` After: ``` Warming up -------------------------------------- tsort initializers 179.000 i/100ms Calculating ------------------------------------- tsort initializers 1.791k (± 1.1%) i/s (558.27 μs/i) - 9.129k in 5.097031s ```
- Loading branch information
Showing
3 changed files
with
96 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters