perf: parallelize slice alignment with multiprocessing#3
Open
Ryo722 wants to merge 1 commit intorotejin:masterfrom
Open
perf: parallelize slice alignment with multiprocessing#3Ryo722 wants to merge 1 commit intorotejin:masterfrom
Ryo722 wants to merge 1 commit intorotejin:masterfrom
Conversation
Use multiprocessing.Pool to run AKAZE/ORB feature detection and matching in parallel across slices. This bypasses Python's GIL limitation and can achieve near-linear speedup on multi-core CPUs. On a 2x2 grid (3 diff slices), this typically yields 2-3x speedup. On a 3x3 grid (8 diff slices), the improvement is more significant.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
スライスの位置合わせ処理を
multiprocessing.Poolで並列化し、マルチコアCPUでの処理速度を向上させます。背景
threadingでは真の並列化ができないため、multiprocessingを使用します効果
Changes
aligner.py:_align_single_slice()トップレベル関数を追加(multiprocessingのpickle要件対応)mask_composer.py:SliceAlignWorker.run()をPool.map()による並列処理に変更Test plan