Skip to content

Speed up path extrusion point generation - #1004

Open
KRRT7 wants to merge 3 commits into
gdsfactory:mainfrom
KRRT7:codex/extrusion-point-generation-perf
Open

Speed up path extrusion point generation#1004
KRRT7 wants to merge 3 commits into
gdsfactory:mainfrom
KRRT7:codex/extrusion-point-generation-perf

Conversation

@KRRT7

@KRRT7 KRRT7 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • replace per-point DCplxTrans construction and NumPy angle conversion with direct normal-vector offset math
  • preserve existing default end-angle behavior and zero-length segment handling

Benchmark

  • extrude_path improved from about 99ms to about 52ms median in benchmarks/hotspots.py local runs
  • extrude_path_dynamic improved from about 151ms to about 63ms median in benchmarks/hotspots.py local runs

Verification

  • uv run ruff check src/kfactory/enclosure.py
  • uv run pytest tests/test_extrude.py tests/test_enclosure.py tests/test_factories_utils.py -q
  • uv run pytest -q passed on the combined local optimization branch

Note: local ty on macOS is fixed separately in PR #1001.

@KRRT7
KRRT7 requested a review from sebastian-goeldi as a code owner June 30, 2026 11:41
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.38462% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.03%. Comparing base (f61117b) to head (eecff29).

Files with missing lines Patch % Lines
src/kfactory/enclosure.py 90.38% 3 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1004      +/-   ##
==========================================
- Coverage   71.05%   71.03%   -0.02%     
==========================================
  Files          72       72              
  Lines       14809    14810       +1     
  Branches     2882     2884       +2     
==========================================
- Hits        10523    10521       -2     
- Misses       3387     3389       +2     
- Partials      899      900       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sebastian-goeldi

Copy link
Copy Markdown
Collaborator

not reviewing pure LLM PRs

@sebastian-goeldi

Copy link
Copy Markdown
Collaborator

what's the speedup here? this is usually not in a very critical path, so small differences in runtime are probably not worth the headache if something's wrong

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.

2 participants