Repository navigation
Commit cb9b3e6
committed
Keep normalized paths that did not change once in the cache
FileHelper's cache of normalized paths kept an array per original path,
holding a second copy of the path - about 500 bytes per entry. Every file
FileFinder finds goes through it, 6,653 paths for Sylius before analysis
starts, which made it 3.2 MB.
Keyed by the directory separator first, an entry is one hash bucket, and a
path that normalizes to itself - nearly all of them - is the same string as
its key: 0.3 MB for those 6,653 paths, and lookups are slightly faster.
Amp-Thread-ID: https://ampcode.com/threads/T-01a1b250-2318-7374-8dd7-2834f59aa7201 parent 6bba813 commit cb9b3e6
1 file changed
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
28 | 34 | | |
29 | 35 | | |
30 | 36 | | |
| |||
63 | 69 | | |
64 | 70 | | |
65 | 71 | | |
66 | | - | |
| 72 | + | |
67 | 73 | | |
68 | 74 | | |
69 | 75 | | |
| |||
109 | 115 | | |
110 | 116 | | |
111 | 117 | | |
112 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
113 | 124 | | |
114 | 125 | | |
115 | 126 | | |
| |||
0 commit comments