Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Make LongSequence and LongSubSeq use Memory [DO NOT MERGE] #317

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jakobnissen
Copy link
Member

This makes these two data types more lightweight, requiring only two memory allocations (one for the sequence and one for its memory) as opposed to two. It also improves data locality since loading from the sequences won't require a double load through the indirection of Vector.

The disadvanges are twofold:
First, we lose support for Julia 1.10 since Memory was introduced in Julia 1.11

Second, Vector's code to grow its underlying memory is much more optimised and tested than the manual implementation here in BioSequences. This would matter if users did a lot of resizing operations on biosequences, like push! or so. However, I think they don't - they are instead much more likely to create a lot of sequences.
If necessary, we can always implement better resizing / growth behaviour for these types.

TODO

  • Wait until we have to drop 1.10 support, perhaps for several years, before merging this.
  • Document the growth behaviour better, e.g. that pushfirst! is O(N)

This makes these two data types more lightweight, requiring only two memory
allocations (one for the sequence and one for its memory) as opposed to two.
It also improves data locality since loading from the sequences won't require
a double load through the indirection of `Vector`.

The disadvanges are twofold:
First, we lose support for Julia 1.10 since Memory was introduced in Julia 1.11

Second, Vector's code to grow its underlying memory is much more optimised and
tested than the manual implementation here in BioSequences. This would matter
if users did a lot of resizing operations on biosequences, like `push!` or so.
However, I think they don't - they are instead much more likely to create a lot
of sequences.
If necessary, we can always implement better resizing / growth behaviour for
these types.
Copy link

codecov bot commented Oct 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.66%. Comparing base (95d9218) to head (06b54a6).
Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #317      +/-   ##
==========================================
- Coverage   90.87%   87.66%   -3.22%     
==========================================
  Files          31       31              
  Lines        2400     2342      -58     
==========================================
- Hits         2181     2053     -128     
- Misses        219      289      +70     
Flag Coverage Δ
unittests 87.66% <100.00%> (-3.22%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants