DynamoRIO / dynamorio

Dynamic Instrumentation Tool Platform
Other
2.64k stars 559 forks source link

drcachesim -record_heap is *very* slow on windows due to symbol lookup #4188

Open derekbruening opened 4 years ago

derekbruening commented 4 years ago

Debug build:

% /usr/bin/time bin64/drrun -t drcachesim -offline -- suite/tests/bin/common.fib.exe only_5
0.00user 0.01system 0:06.06elapsed 0%CPU (0avgtext+0avgdata 3996maxresident)k

% /usr/bin/time bin64/drrun -t drcachesim -offline -record_function 'fib|1' -- suite/tests/bin/common.fib.exe only_5
0.00user 0.01system 0:19.47elapsed 0%CPU (0avgtext+0avgdata 3996maxresident)k

% /usr/bin/time bin64/drrun -t drcachesim -offline -record_heap -- suite/tests/bin/common.fib.exe only_5
0.00user 0.01system 3:35.25elapsed 0%CPU (0avgtext+0avgdata 3972maxresident)k

Adding timestamps for diagnostics, it looks like the system modules are taking 12s-14s each which really adds up.

This is a known issue for large apps where dbghelp.dll takes a long time to query symbols, but it is a little surprising for smaller system libraries.

Possible solutions:

derekbruening commented 4 years ago

For #4187 I am adding -record_dynsym_only. TODO: Check whether this is enough for our Windows tests.