Skip to content

Comments

Refactor BLAST::Report to lazily generate reports #734

Merged
yannickwurm merged 2 commits intowurmlab:masterfrom
tadast:tt/lazy-report
Mar 21, 2024
Merged

Refactor BLAST::Report to lazily generate reports #734
yannickwurm merged 2 commits intowurmlab:masterfrom
tadast:tt/lazy-report

Conversation

@tadast
Copy link
Collaborator

@tadast tadast commented Mar 20, 2024

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.

tadast added 2 commits March 20, 2024 17:13
We're about to refactor the BLAST::Report class, and it does not
seem to have any unit tests. The implementation is a bit hard to
comprehend with generic abbreviated variable names and data accessed
via indexes. To aid the refactoring, create a regression test that
takes a job generated on current master as gold standard and compares
it with the live version. If refactoring changes the outputs, the test
will fail.
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.
@tadast tadast changed the title [WIP] Refactor BLAST::Report to lazily generate reports Refactor BLAST::Report to lazily generate reports Mar 21, 2024
@yannickwurm yannickwurm merged commit 0f9acaa into wurmlab:master Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants