Commit e249e6d
committed
perf: add fast path checks when resolving config (#437)
- part of #295
For a directory with ~860 files in it, a ~26% improvement:
<img width="1185" height="239" alt="Screenshot 2025-11-18 at 12 18 22 AM" src="https://github.com/user-attachments/assets/01b05dd9-6c83-4669-a4ce-8471afe9ef40" />
I tested a subset of `kibana` locally on my laptop that had 6.6k files in it and it was a much more modest improvement of about 4%. So this is a "small project" optimization that will largely benefit small libraries or projects, and will slightly improve performance for large monorepos.
Here are some examples running on the same set of ~850 files in each case:
### Before
Taking up over a gigabyte in total allocations, and represents over 40% of all allocations:
<img width="713" height="286" alt="Screenshot 2025-11-18 at 12 12 17 AM" src="https://github.com/user-attachments/assets/6b44863c-98a8-4dfd-9292-e9b365aefa8d" />
<img width="1227" height="350" alt="Screenshot 2025-11-17 at 11 27 19 PM" src="https://github.com/user-attachments/assets/cbcd14c5-9ba7-4408-b124-f140cbbc3748" />
### After
Takes up only 0.6% of the total allocations and a few megabytes:
<img width="467" height="211" alt="Screenshot 2025-11-18 at 9 56 06 AM" src="https://github.com/user-attachments/assets/69d88e09-d9bd-4194-a600-845ddd065cbd" />
<img width="546" height="279" alt="Screenshot 2025-11-18 at 9 54 53 AM" src="https://github.com/user-attachments/assets/c15fae1b-82ff-42e2-92b4-5fac1736306e" />1 parent 06d4607 commit e249e6d
1 file changed
+34
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
106 | 108 | | |
107 | 109 | | |
108 | 110 | | |
109 | | - | |
110 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
111 | 143 | | |
112 | 144 | | |
113 | 145 | | |
| |||
0 commit comments