Closed zchmielewska closed 1 year ago
CSVReader keeps data as a defaultdict
. Cache'ing would require also some kind of a dict so there is no really a point in that.
It would make sense if indeed we have a table with say 1000 values and we only use 10. But is that the case? I think not necessarily.
The trade-off is additional memory-usage for the cache. And the problem is that this memory is used during the model and not before. So I think let's pause this topic for now.
Let's say we've got mortality table with 100 ages and we have 100_000 model points.
The CSV reader has to (assuming uniform distribution) find the same value 1000 times.
So maybe it's worth to add caching to the CSV reader class to improve runtime?