Skip to content

Speed up Acton benchmark loops - #5

Open
plajjan wants to merge 6 commits into
mainfrom
knucleotide-counters
Open

plajjan wants to merge 6 commits into
mainfrom
knucleotide-counters

Conversation

@plajjan

@plajjan plajjan commented Sep 20, 2026 •

Copy link
Copy Markdown

These Acton ports allocate temporary numbers and repeat work in their inner loops. Reuse k-nucleotide counters, index short keys directly, and keep spectral-norm denominators as floats.

For nsieve, start marking at each prime's square and store flags in a bytearray with slice updates.

Repeated k-mers need three dictionary operations and a new boxed count.
Keep one mutable counter per key so updates use one lookup and increment
a native integer field.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-20T10:02:16.455246Z 327079b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Kristian Larsson added 4 commits September 20, 2026 12:57
Converting the denominator for every matrix element allocates a temporary
integer. Keep the denominator and its increment as floats throughout each
row. Both remain exact integers at the benchmark sizes.
The sieve revisits composites already marked by smaller primes and marks
each prime itself. Start at the square of each prime and skip marking
when that square is outside the table.
A list of boolean pointers makes the sieve table unnecessarily large.
Store one byte per flag, clear composite positions with slice assignment,
and count the remaining prime flags after marking.
Keys up to six bases have at most 4096 possible values. Count them in a
small array of reusable counters instead of hashing every occurrence.
Keep only observed keys in the returned table and use the existing hash
table for longer keys.
@plajjan plajjan changed the title Reuse counters in Acton k-nucleotide Speed up Acton benchmark loops Sep 20, 2026
Some benchmark code exists to avoid temporary allocations in Acton.
Name the counter StupidBox, update its value directly, and leave
TODOs for revisiting these workarounds as the compiler improves.

This branch has not been deployed

No deployments
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