next.js
4e355ccb - Turbopack: Use a BTreeMap in InvalidatorMap to avoid many `O(n)` traversals when finding child paths (#82133)

Commit
145 days ago
Turbopack: Use a BTreeMap in InvalidatorMap to avoid many `O(n)` traversals when finding child paths (#82133) This fixes an `O(n)` iteration of the invalidators (which can be quite large) in `invalidate_path_and_children_execute`. It requires the nightly `btree_cursors` API. It's possible to implement this without that API, but it'd be a lot less efficient, and I'm concerned about how hot this codepath might be. This codepath is used for both the recursive and non-recursive filesystem watcher, so it impacts all platforms.
Author
bgw bgw
Parents
Loading