lucasg / Dependencies

A rewrite of the old legacy software "depends.exe" in C# for Windows devs to troubleshoot dll load dependencies issues.
MIT License
8.98k stars 733 forks source link

remove `BinaryCache.FilepathDatabase` to make cache works correct #265

Open viruscamp opened 4 months ago

viruscamp commented 4 months ago
  1. remove BinaryCache.FilepathDatabase to disable loading cache by file path, fix #54
  2. lazy-load cached files to reduce memory footprint (WS Shareable)
  3. update and use LastAccessTime of cached files to make LRU more reasonable
  4. refactoring to clear the two level cache architecture: BinaryDatabase as memory cache and BinaryCacheFolderPath as disk cache
    • BinaryDatabase keeps only loaded PE, but not all file in BinaryCacheFolderPath
    • remove LruCache totally, LRU is arranged by set LastAccessTime to file, Unload deletes outdated cache files by LastAccessTime
viruscamp commented 4 months ago

Simple benchmark about memory usage:

  1. 82MiB of WS Shareable, after startup loading 0 cached file
  2. 158.8MiB of WS Shareable, after startup loading 81 well known system dlls
  3. 225.5MiB of WS Shareable, after startup loading 200 cached file