Skip to content

Migrate remaining k-mer functionalities to Rust#920

Open
padix-key wants to merge 1 commit into
biotite-dev:mainfrom
padix-key:rust-kmer-misc
Open

Migrate remaining k-mer functionalities to Rust#920
padix-key wants to merge 1 commit into
biotite-dev:mainfrom
padix-key:rust-kmer-misc

Conversation

@padix-key

Copy link
Copy Markdown
Member

Pursuing #688, this PR migrates the remaining k-mer related functionalities to Rust. This includes

  • KmerAlphabet
  • KmerSelector
  • Permutation
  • SimilarityRule

Benchmarks ensured that the new implementations run at least approximately as fast as the legacy Cython implementation.

@codspeed-hq

codspeed-hq Bot commented Jun 29, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 23.99%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 12 improved benchmarks
✅ 91 untouched benchmarks
⏩ 4 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
benchmark_score_threshold_rule[11*11*1*1***111] 1.9 s 1.2 s +56.1%
benchmark_score_threshold_rule[None] 2 s 1.3 s +56.05%
benchmark_kmer_decomposition[11*11*1*1***111] 171.8 µs 134 µs +28.28%
benchmark_kmer_decomposition[None] 122.9 µs 96.8 µs +27%
benchmark_similar_kmers 292.8 µs 240.8 µs +21.59%
benchmark_indexing_from_sequences[11*11*1*1***111-BucketKmerTable(100000)] 17.3 ms 14.3 ms +20.79%
benchmark_indexing_from_sequences[11*11*1*1***111-KmerTable] 18 ms 15 ms +19.5%
benchmark_indexing_from_sequences[None-BucketKmerTable(100000)] 7.8 ms 6.7 ms +15.39%
benchmark_match[BucketKmerTable(10000)-None] 423.6 µs 368.2 µs +15.04%
benchmark_indexing_from_sequences[None-KmerTable] 8.6 ms 7.5 ms +14.03%
benchmark_match[KmerTable-None] 333.7 µs 295 µs +13.13%
benchmark_match_kmer_selection[BucketKmerTable(10000)-None] 354.3 µs 320 µs +10.71%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing padix-key:rust-kmer-misc (2d86546) with main (9e9f6a1)

Open in CodSpeed

Footnotes

  1. 4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@padix-key padix-key changed the title Rust kmer misc Migrate remaining k-mer functionalities to Rust Jun 29, 2026
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.

1 participant