From 0f677f694614fb429b89be7f27ce33b600fa59d0 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Tue, 18 Oct 2022 12:38:33 +0200 Subject: [PATCH 1/3] [MISC] Improve performance of bitpacked_sequence --- include/seqan3/alphabet/container/bitpacked_sequence.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/seqan3/alphabet/container/bitpacked_sequence.hpp b/include/seqan3/alphabet/container/bitpacked_sequence.hpp index 9ebeb1f45a..89ddde0ff6 100644 --- a/include/seqan3/alphabet/container/bitpacked_sequence.hpp +++ b/include/seqan3/alphabet/container/bitpacked_sequence.hpp @@ -91,7 +91,7 @@ class bitpacked_sequence //!\brief Update the sdsl-proxy. constexpr void on_update() noexcept { - internal_proxy = static_cast(*this).to_rank(); + internal_proxy = base_t::to_rank(); } public: @@ -110,10 +110,12 @@ class bitpacked_sequence ~reference_proxy_type() noexcept = default; //!< Defaulted. //!\brief Initialise from internal proxy type. - reference_proxy_type(std::ranges::range_reference_t const & internal) noexcept : + reference_proxy_type(std::ranges::range_reference_t const internal) noexcept : internal_proxy{internal} { - static_cast(*this).assign_rank(internal); + // Call alphabet_base's assign_rank to prevent calling on_update() during construction + // which is not necessary, because internal_proxy is already correctly initialised! + base_t::base_t::assign_rank(static_cast>(internal)); } //!\} }; From a22fb5a01b2441523e3274e27a6b1a864ee96ac8 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Tue, 18 Oct 2022 13:28:24 +0200 Subject: [PATCH 2/3] [TEST] Add SeqAn2 container benchmarks --- .../range/container_push_back_benchmark.cpp | 75 ++++++++++- .../range/container_seq_read_benchmark.cpp | 117 ++++++++++++++++-- .../range/container_seq_write_benchmark.cpp | 66 ++++++++-- 3 files changed, 240 insertions(+), 18 deletions(-) diff --git a/test/performance/range/container_push_back_benchmark.cpp b/test/performance/range/container_push_back_benchmark.cpp index a0d2c12a00..064c58729f 100644 --- a/test/performance/range/container_push_back_benchmark.cpp +++ b/test/performance/range/container_push_back_benchmark.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include template @@ -31,14 +32,14 @@ using small_vec = seqan3::small_vector; template