Skip to content

Migrate alignment functions to Rust#916

Merged
padix-key merged 6 commits into
biotite-dev:mainfrom
padix-key:rust-alignment
Jun 26, 2026
Merged

Migrate alignment functions to Rust#916
padix-key merged 6 commits into
biotite-dev:mainfrom
padix-key:rust-alignment

Conversation

@padix-key

Copy link
Copy Markdown
Member

Continuing #688, this PR migrates the following functions to Rust:

  • align_optimal()
  • align_banded()
  • align_local_gapped()
  • align_local_ungapped()
  • align_ungapped()

In addition now all these functions support

  • match/mismatch scoring schemes without a substitution matrix
  • an faster score-only modes, only returning the alignment score instead of the full alignment.

As align_local_ungapped() already runs fast, the Python interface becomes the bottleneck. Hence the function is deprecated and replaced by SeedExtension, which is only created once and run for multiple ungapped local alignments, reducing repetitive input processing in the Python interface

@codspeed-hq

codspeed-hq Bot commented Jun 24, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by ×2

⚡ 3 improved benchmarks
✅ 94 untouched benchmarks
🆕 6 new benchmarks
⏩ 4 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
benchmark_align_multiple 19.2 s 4.3 s ×4.5
benchmark_concatenate 195.4 µs 129.5 µs +50.87%
benchmark_superimpose[superimpose_structural_homologs] 29.5 ms 23.8 ms +23.67%
🆕 benchmark_align_pairwise[align_banded-score_only] N/A 3.8 ms N/A
🆕 benchmark_align_pairwise[align_banded-traceback] N/A 6.1 ms N/A
🆕 benchmark_align_pairwise[align_local_gapped-score_only] N/A 45.4 ms N/A
🆕 benchmark_align_pairwise[align_local_gapped-traceback] N/A 58.1 ms N/A
🆕 benchmark_align_pairwise[align_optimal-score_only] N/A 66.4 ms N/A
🆕 benchmark_align_pairwise[align_optimal-traceback] N/A 78.5 ms N/A

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-alignment (fe1601a) with main (a2cab9a)2

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.

  2. No successful run was found on main (641afc4) during the generation of this report, so a2cab9a was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@padix-key padix-key marked this pull request as ready for review June 24, 2026 14:13
@padix-key padix-key merged commit 267f041 into biotite-dev:main Jun 26, 2026
24 checks passed
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