Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

πŸ’‘ What: Optimized the creation of lookup_keys set in Repliconf.search.
🎯 Why: The previous implementation used set(Nucleotides.TEMPLATE) followed by update with a list comprehension, which involved redundant list allocation and Python-level iteration.
πŸ“Š Measured Improvement:

  • Benchmark isolated to the lookup_keys creation showed a significant speedup:
    • Baseline: ~2.21 Β΅s per call
    • Optimized: ~0.85 Β΅s per call
    • Improvement: ~2.6x faster for this specific operation.
  • This reduces the overhead of Repliconf.search initialization, which can be beneficial when performing many searches.

PR created automatically by Jules for task 42424823925354820 started by @fangfufu

google-labs-jules bot and others added 4 commits January 26, 2026 03:54
…91)

This change pre-calculates the reverse complement of the primer in the `Repliconf` object and reuses it during amplicon generation. This avoids repeated expensive `DNA.reverse_complement()` calls inside the `get_amplicons` loop, leading to a measured ~17% performance improvement in a benchmark scenario with many potential amplicons.

Changes:
- Added `rev_comp_primer` attribute to `Repliconf` in `src/amplifyp/repliconf.py`.
- Updated `AmpliconGenerator._construct_amplicon_sequence` in `src/amplifyp/amplicon.py` to use `rev_conf.rev_comp_primer`.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
This change modifies `src/amplifyp/gui2/map_view.py` to correctly visualize amplicons that wrap around the origin of a circular DNA template. Previously, such amplicons were not drawn (or drawn incorrectly with negative width). Now, they are drawn as two segments: one from the start index to the end of the template, and another from the beginning of the template to the end index. The size label is placed on the longer of the two segments.

Tested with a reproduction script mocking the GUI environment and verified no regressions with existing tests.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Pre-calculate `_seq_upper` in `__init__` to avoid repeated string
allocations in `_count_bases`, `__eq__`, and `__hash__`. Reuse the
original sequence string if it is already uppercase to save memory.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Fufu Fang <fangfufu2003@gmail.com>
- Replace set creation and update loop with a single set construction from concatenated strings.
- Reduces allocation overhead and improves performance of Repliconf.search initialization.
- Benchmark showed ~2.6x speedup for this specific operation (0.22s -> 0.085s for 100k iters).
@google-labs-jules
Copy link
Contributor Author

πŸ‘‹ Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a πŸ‘€ emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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