wurmlab / sequenceserver

Intuitive graphical web interface for running BLAST bioinformatics tool (i.e. have your own custom NCBI BLAST site!)
https://sequenceserver.com
GNU Affero General Public License v3.0
268 stars 111 forks source link

Refactor BLAST::Report to lazily generate reports #734

Closed tadast closed 5 months ago

tadast commented 5 months ago

In some cases (e.g. when used by some extensions) it is beneficial to not generate the report files upfront, and only do it when it's required. Performance gains are significant with large result sets (i.e. hundreds of MB or GBs) as the data does not need to be loaded into the process memory.

Lazy method evaluation with memoization allows to achieve just that without cognitive overload to developer - operations are now only executed when the methods are invoked, not up-front by default.

Implementation logic was not changed and regression test prepared upfront is not failing and producing identical results.