-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate 2D image cache away from std::vector<float> #967
Comments
@veggiesaurus, do we have any design constraint to resist introducing c-style arrays here in favor of a significant performance gain for large images? |
No, thats totally fine, as long as they are carefully cleaned up. We don't actually ever need to resize the image cache if I recall correctly |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We currently use a
std::vector<float>
forFrame::_image_cache
. However, the ability to resize the image cache is not of any use, because a new cache is made for each separate image, and all image channels have the same 2D slice size. The main problem with using astd::vector
is that we end up allocating memory and initialising to zero before we fill it with values from disk. This means it will always be slower than something like a simple c-style array.This is not a problem for small images, but for large images it can become a substantial portion of the initial image load time.
The text was updated successfully, but these errors were encountered: