Skip to content

Speed up qbip - #1188

Merged
jgostick merged 5 commits into
devfrom
speed-up-qbip
Sep 9, 2026
Merged

Speed up qbip#1188
jgostick merged 5 commits into
devfrom
speed-up-qbip

Conversation

@jgostick

@jgostick jgostick commented Sep 9, 2026

Copy link
Copy Markdown
Member

This PR substantially improves QBIP and trapping performance while preserving existing results.

  • Simplifies QBIP heap entries to contain only pressure and a flat voxel index.
  • Eliminates per-voxel neighbor-list allocations.
  • Separates invasion traversal from sphere drawing.
  • Skips spheres already contained within the invaded region.
  • Accelerates sphere rasterization using distance lookups and scan-line traversal.
  • Avoids allocating disabled pressure and size outputs.
  • Uses compact sequence and intermediate-array dtypes.
  • Optimizes trapping with flat heap indices, direct neighbor insertion, smaller equal-sequence batches, fewer full-image temporaries, and direct mask generation.

Representative benchmarks showed approximately 10× faster QBIP and 12.5× faster trapping. A 500³ QBIP simulation completed in about 8.4 minutes, while the optimized trapping pass on a 220³ image fell from 13.5 s to 1.08 s. Memory use is also substantially reduced, particularly when optional outputs are disabled.

@jgostick
jgostick merged commit 00559b4 into dev Sep 9, 2026
17 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