|Title||»||Create ToolReportCache class to make repeated analysis faster|
We need to create a class called ToolReportCache that stores recently run reports, up to some memory limit (e.g. 50M).
I just ran MSstats on the Human_plasma data set, and it took 90 seconds to export the necessary report, which was only 2M in size. We could easily store that as a string in memory (though the string would probably be 4M in size, due to C# string using Unicode characters). We could store several of these reports in memory, up to a memory limit, and clear them out of the cache whenever the document changes.
We could store report results by report name, saving: the report text, and the report template. The cache could listen for document changed events, and clear the stored reports on any change. At report request time, the tool would check for a stored report in the cache, and then check to make sure the current report template matches the one for which the result is cached. If it found a match, then the report could be provided instantly.
Especially, now that tools are getting more complex, it may take several runs on a document to produce the desired analysis, and requiring a full build of the required report on every run has become a real pain point.