Apply hoist optimizations to Geometry.c's transforms - #9788
Conversation
Merging this PR will improve performance by 13.77%
|
| int in_xsize = imIn->xsize, in_ysize = imIn->ysize; | ||
| int out_xsize = imOut->xsize, out_ysize = imOut->ysize; | ||
|
|
||
| if (in_xsize != out_xsize || in_ysize != out_ysize) { |
There was a problem hiding this comment.
Could you explain how this is an improvement? I mean, it wasn't using the values within a loop. There was no repetition at all.
There was a problem hiding this comment.
You mean out_xsize/out_ysize? Yes, they're not used in the loops, but I think it reads more cleanly for the human reader if it's
if (in_xsize != out_xsize || in_ysize != out_ysize) {and not
if (in_xsize != imOut->xsize || in_ysize != imOut->ysize) {-- with the latter, at least my code eye starts wondering why there's two different idioms for the sizes.
Like the other recent optimization PRs: hoist
im*->xsizeandim*->ysizeinto locals so autovectorization can do its thing.