Commit 388a7c4
authored
Cache debugger patches to speed up x64 stackwalk epilogue/prologue scanning (#125459)
Second partial fix for #122459
Caches the list of debugger breakpoint patches in the DAC so that x64
stack unwinding doesn't re-scan the patch hash table on every frame.
During mini dump collection, each stack frame triggers
DacReplacePatchesInHostMemory to restore original opcodes before reading
memory — even though there are typically zero active patches during a
dump. The patch hash table has 1,000 fixed buckets, so each call walked
all of them regardless. The cache is populated once on first access and
invalidated only on Flush().
Measured minidump collection against the same repro app with 10,000
iterations across 10 threads. The baseline was 55s, this change alone
brings it to ~7s1 parent 9f85e5d commit 388a7c4
3 files changed
Lines changed: 95 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3286 | 3286 | | |
3287 | 3287 | | |
3288 | 3288 | | |
| 3289 | + | |
| 3290 | + | |
| 3291 | + | |
3289 | 3292 | | |
3290 | 3293 | | |
3291 | 3294 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1352 | 1352 | | |
1353 | 1353 | | |
1354 | 1354 | | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
1355 | 1398 | | |
1356 | 1399 | | |
1357 | 1400 | | |
1358 | 1401 | | |
1359 | 1402 | | |
1360 | | - | |
1361 | | - | |
1362 | | - | |
1363 | | - | |
1364 | | - | |
1365 | | - | |
1366 | | - | |
1367 | | - | |
1368 | | - | |
1369 | | - | |
1370 | | - | |
1371 | 1403 | | |
1372 | 1404 | | |
1373 | 1405 | | |
1374 | 1406 | | |
1375 | 1407 | | |
1376 | 1408 | | |
1377 | | - | |
1378 | | - | |
1379 | | - | |
1380 | | - | |
1381 | | - | |
1382 | | - | |
1383 | | - | |
1384 | | - | |
1385 | | - | |
1386 | | - | |
1387 | | - | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
1388 | 1413 | | |
1389 | 1414 | | |
1390 | 1415 | | |
1391 | 1416 | | |
1392 | 1417 | | |
1393 | | - | |
| 1418 | + | |
1394 | 1419 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
792 | 792 | | |
793 | 793 | | |
794 | 794 | | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
795 | 837 | | |
796 | 838 | | |
797 | 839 | | |
| |||
1420 | 1462 | | |
1421 | 1463 | | |
1422 | 1464 | | |
| 1465 | + | |
| 1466 | + | |
1423 | 1467 | | |
1424 | 1468 | | |
1425 | 1469 | | |
| |||
0 commit comments