SaitoTsutomu / knapsack

Apache License 2.0
5 stars 1 forks source link

Configurable lru_cache #1

Closed duubi closed 1 year ago

duubi commented 1 year ago

Hello, the lru_cache (currently @lru_cache(maxsize=4096)) should be configurable. E.g. with 500 size/weight elements and capacity of 70000, the solution wasn't found on an actual Intel 3,2 GHz CPU even after more than 20 hours. After modification @lru_cache(maxsize=4096*4096) was introduced, the solution was found within 1 minute, consuming approx 7GB of RAM.

SaitoTsutomu commented 1 year ago

@duubi

After modification @lru_cache(maxsize=4096*4096) was introduced, the solution was found within 1 minute, consuming approx 7GB of RAM.

The following has been addressed. And, various other fixes have been made. https://github.com/SaitoTsutomu/knapsack/commit/9acc54e8317ca54fb929ae511a43aaa795830a8a