Skip to content

faster mask to bool casting in GeffTracksBuilder - #294

Open
TeunHuijben wants to merge 1 commit into
mainfrom
speedup-masks-as-bool
Open

faster mask to bool casting in GeffTracksBuilder#294
TeunHuijben wants to merge 1 commit into
mainfrom
speedup-masks-as-bool

Conversation

@TeunHuijben

Copy link
Copy Markdown
Collaborator

The old mask.astype(bool) always makes a copy, even when the mask is already a bool, which is slow.

np.asarray(mask, dtype=bool) does the same casting, but without the copy when the type already matches > faster

Probably not detected in benchmark, but is a significant different on large graphs

@TeunHuijben TeunHuijben added ⚡ performance Improve speed or scalability ready for initial review PR ready for first review labels Sep 12, 2026
@codecov

codecov Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.95%. Comparing base (1de5412) to head (30cf9b3).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #294   +/-   ##
=======================================
  Coverage   93.95%   93.95%           
=======================================
  Files          60       60           
  Lines        3589     3589           
=======================================
  Hits         3372     3372           
  Misses        217      217           

☔ 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.

@TeunHuijben TeunHuijben added the ⌛ quick fix For when you have 15 minutes free label Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⌛ quick fix For when you have 15 minutes free ready for initial review PR ready for first review ⚡ performance Improve speed or scalability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant