-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This hadn't been noticed previously since N is generally small, eg. 50 or 60 at most. Working with a Metabase dashboard that loaded 10000 fields (100 each from 100 tables) in a single `select` + `hydrate`, I found this was consuming about 3 seconds. The slow path was effectively a very slow `conj`: taking the `acc` vector, and then for each `annotated-instances` doing: ```clojure (recur (vec (concat acc nil [(first hydrated-instances)])) ...) ``` which is pouring the whole vector into a lazy sequence and back into a vector, once for each instance in the list. The new version first creates an "index" of instances that need hydration, and later uses that index to map the instances in the hydrated instances batch to their places in the initial collection. Co-authored-by: Braden Shepherdson <braden@metabase.com>
- Loading branch information
1 parent
33b4f54
commit ad2791e
Showing
2 changed files
with
36 additions
and
62 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