Skip to content

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

Draft
jakobnissen wants to merge 1 commit into
BioJulia:masterfrom
jakobnissen:mem
Draft

WIP Make LongSequence and LongSubSeq use Memory [DO NOT MERGE]#317
jakobnissen wants to merge 1 commit into
BioJulia:masterfrom
jakobnissen:mem

Conversation

@jakobnissen

Copy link
Copy Markdown
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.
@codecov

codecov Bot commented Oct 21, 2024

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.66%. Comparing base (95d9218) to head (06b54a6).
⚠️ Report is 28 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 Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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