seqan3 icon indicating copy to clipboard operation
seqan3 copied to clipboard

[WIP] What if alphabets were trivial?

Open eseiler opened this issue 3 years ago • 2 comments

std::vector optimizes assignments to std::copy (basically memcpy) iff the value_type is trivial. If not, it will use std::unintialized_copy which will use placement-new and is around 2-3 times slower.

Method Container Alphabet Iterations before Iterations after
tag::assignment_operator std::vector seqan3::aa27 705 1853
tag::assignment_operator std::vector seqan3::dna4 741 1869
tag::assignment_operator std::vector seqan3::dna5 744 1879
tag::std_copy std::vector seqan3::aa27 1691 1871
tag::std_copy std::vector seqan3::dna4 1852 1800
tag::std_copy std::vector seqan3::dna5 1781 1865
tag::uninitialized_copy std::vector seqan3::aa27 711 1789
tag::uninitialized_copy std::vector seqan3::dna4 705 1856
tag::uninitialized_copy std::vector seqan3::dna5 727 1859
tag::assignment_operator std::vector seqan::AminoAcid 740 741
tag::assignment_operator std::vector seqan::Dna 733 726
tag::assignment_operator std::vector seqan::Dna5 747 727
tag::std_copy std::vector seqan::AminoAcid 1839 1811
tag::std_copy std::vector seqan::Dna 1766 1837
tag::std_copy std::vector seqan::Dna5 1830 1847
tag::uninitialized_copy std::vector seqan::AminoAcid 734 741
tag::uninitialized_copy std::vector seqan::Dna 742 739
tag::uninitialized_copy std::vector seqan::Dna5 731 735
tag::assignment_operator seqan::String seqan::AminoAcid 1835 1938
tag::assignment_operator seqan::String seqan::Dna 1819 1910
tag::assignment_operator seqan::String seqan::Dna5 1903 1944
tag::std_copy seqan::String seqan::AminoAcid 720 721
tag::std_copy seqan::String seqan::Dna 723 734
tag::std_copy seqan::String seqan::Dna5 723 726
tag::uninitialized_copy seqan::String seqan::AminoAcid 721 719
tag::uninitialized_copy seqan::String seqan::Dna 722 723
tag::uninitialized_copy seqan::String seqan::Dna5 719 728

eseiler avatar Jun 24 '22 15:06 eseiler

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
seqan3 ✅ Ready (Inspect) Visit Preview Oct 18, 2022 at 11:35AM (UTC)

vercel[bot] avatar Jun 24 '22 15:06 vercel[bot]

Codecov Report

Base: 98.21% // Head: 98.21% // Decreases project coverage by -0.00% :warning:

Coverage data is based on head (d0011c9) compared to base (c3113fa). Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3038      +/-   ##
==========================================
- Coverage   98.21%   98.21%   -0.01%     
==========================================
  Files         275      274       -1     
  Lines       12244    12204      -40     
==========================================
- Hits        12026    11986      -40     
  Misses        218      218              
Impacted Files Coverage Δ
include/seqan3/alphabet/alphabet_base.hpp 100.00% <ø> (ø)
...clude/seqan3/alphabet/aminoacid/aminoacid_base.hpp 100.00% <ø> (ø)
include/seqan3/alphabet/aminoacid/aa20.hpp 100.00% <0.00%> (ø)
include/seqan3/alphabet/aminoacid/aa27.hpp 100.00% <0.00%> (ø)
include/seqan3/alphabet/structure/wuss.hpp 100.00% <0.00%> (ø)
include/seqan3/alphabet/nucleotide/dna4.hpp 100.00% <0.00%> (ø)
include/seqan3/alphabet/nucleotide/dna5.hpp 100.00% <0.00%> (ø)
include/seqan3/alphabet/nucleotide/rna4.hpp 100.00% <0.00%> (ø)
include/seqan3/alphabet/nucleotide/rna5.hpp 100.00% <0.00%> (ø)
... and 20 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Jun 25 '22 13:06 codecov[bot]

~~Blocked by https://github.com/seqan/seqan3/pull/3037~~

eseiler avatar Oct 18 '22 09:10 eseiler