Commit 61b9746
committed
Speed up rebuilding the loaded feature index
Rebuilding the loaded feature index slowed down with the bug fix
for #17885 in 79a4484. The
slowdown was extreme if realpath emulation was used, but even when
not emulated, it could be about 10x slower.
This adds loaded_features_realpath_map to rb_vm_struct. This is a
hidden hash mapping loaded feature paths to realpaths. When
rebuilding the loaded feature index, look at this hash to get
cached realpath values, and skip calling rb_check_realpath if a
cached value is found.
Fixes [Bug #19246]1 parent 0ac3f2c commit 61b9746
3 files changed
+26
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
166 | 172 | | |
167 | 173 | | |
168 | 174 | | |
| |||
361 | 367 | | |
362 | 368 | | |
363 | 369 | | |
| 370 | + | |
| 371 | + | |
364 | 372 | | |
| 373 | + | |
365 | 374 | | |
366 | 375 | | |
367 | 376 | | |
| |||
378 | 387 | | |
379 | 388 | | |
380 | 389 | | |
381 | | - | |
382 | | - | |
383 | | - | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
384 | 398 | | |
385 | 399 | | |
386 | 400 | | |
| |||
1161 | 1175 | | |
1162 | 1176 | | |
1163 | 1177 | | |
| 1178 | + | |
1164 | 1179 | | |
1165 | 1180 | | |
1166 | 1181 | | |
| |||
1252 | 1267 | | |
1253 | 1268 | | |
1254 | 1269 | | |
1255 | | - | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
1256 | 1273 | | |
1257 | 1274 | | |
1258 | 1275 | | |
| |||
1473 | 1490 | | |
1474 | 1491 | | |
1475 | 1492 | | |
| 1493 | + | |
| 1494 | + | |
1476 | 1495 | | |
1477 | 1496 | | |
1478 | 1497 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2699 | 2699 | | |
2700 | 2700 | | |
2701 | 2701 | | |
| 2702 | + | |
2702 | 2703 | | |
2703 | 2704 | | |
2704 | 2705 | | |
| |||
2790 | 2791 | | |
2791 | 2792 | | |
2792 | 2793 | | |
| 2794 | + | |
2793 | 2795 | | |
2794 | 2796 | | |
2795 | 2797 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
676 | 676 | | |
677 | 677 | | |
678 | 678 | | |
| 679 | + | |
679 | 680 | | |
680 | 681 | | |
681 | 682 | | |
| |||
0 commit comments