[Insight-developers] Patch Set to minimize calls to GetInput/GetOutput
Williams, Norman K
norman-k-williams at uiowa.edu
Fri Jul 20 15:26:27 EDT 2012
Initial work done by Bradley Lowencamp.
http://review.source.kitware.com/#/c/6570/
This patch is passing all the regression tests. I would welcome people
trying the patch out on their real-world code and desk-check it to see if
I missed something.
A completely unscientific benchmark -- the total time running ctest for
ITK -- shows a modest improvement in execution time; I suspect that the
actual speedup is better than this; I ran all tests instead of just
running tests that would be affected by removing the inner loop callbacks
to GetInput and GetOutput
Without Patch:
Total Test time (real) = 652.27 sec
2040.613u 168.422s 10:52.58 338.5% 0+0k 30+1724io 16130pf+0w
With Patch
Total Test time (real) = 634.32 sec
1874.695u 165.739s 10:34.64 321.5% 0+0k 0+1744io 1355pf+0w
In general, it would be better to call GetInput or GetOutput once in a
function rather than calling it over and over again, as is often the case,
but I decided that it wasn't worth the effort -- and the risk accidentally
break something -- of fixing everyplace I saw code that did this. But
developers should keep in mind that these methods are not free, and
program accordingly.
--
Kent Williams norman-k-williams at uiowa.edu
________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited. Please reply to the sender that you have received the message in error, then delete it. Thank you.
________________________________
More information about the Insight-developers
mailing list