dlang-community / dsymbol

Basic symbol lookup/resolution for libdparse (Deprecated, see link)
https://github.com/dlang-community/DCD/tree/master/dsymbol
Boost Software License 1.0
16 stars 19 forks source link

83x speed up `resolveImportLocation` #151

Closed WebFreak001 closed 4 years ago

WebFreak001 commented 4 years ago

This gives a big speed up improvement in DCD on Windows:

Duration of first completion (ms)

Old (Debug) New (Debug) Old (Release) New (Release)
457792 5600 98314 3878
457994 5463 97429 3756
5471 98454 3805
average 457893 5511 98066 3813
relative speed 100% 8308% 100% 2572%

Duration of later completions (ms)

Old (Debug) New (Debug) Old (Release) New (Release)
177 66 163 61
190 62 172 46
192 61 155 67
average 186 63 163 58
relative speed 100% 296% 100% 282%

LDC 1.19.0 Target: x86_64-pc-windows-msvc Host CPU: ivybridge very little available RAM (<500 MB) some SSD

WebFreak001 commented 4 years ago

Linux timings

note: these are also on a much more powerful machine, but I believe most speed reduction between OSs comes from fewer system wide import paths

Duration of first completion (ms)

Old (Debug) New (Debug) Old (Release) New (Release)
10525 3306 9673 1516
10518 3268 9839 1525
10468 3261 9636 1552
average 10504 3278 9716 1531
relative speed 100% 320% 100% 635%

Duration of later completions (ms)

Old (Debug) New (Debug) Old (Release) New (Release)
84 20 93 7
116 23 91 11
85 23 91 11
average 95 22 92 10
relative speed 100% 432% 100% 948%

LDC 1.22.0 Target: x86_64-pc-linux-gnu Host CPU: znver1 lots of available RAM fast NVMe SSD

WebFreak001 commented 4 years ago

I would make a patch release to be compatible with the other newly released dsymbol for practical reasons now: