-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PERF: Speed up full, grid, sparse mask samplers by a local sampleVector
Did speed up `ImageFullSampler`, `ImageGridSampler`, and `ImageRandomSamplerSparseMask` by doing the `push_back`'s of samples to a local `std::vector` of samples (instead of directly to the sample container), and then eventually swapping the vector "into" the sample container. When using `ImageFullSampler` on a 4096 x 4096 input image, a `sampler.Update()` call originally took more than 0.38 seconds, but it went down to almost 0.20 seconds with this commit, as observed using Visual C++ 2019 (Release configuration).
- Loading branch information
Showing
3 changed files
with
38 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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