[Insight-developers] Iterator VS IteratorWithIndex Speed

Stephen R. Aylward aylward@unc.edu
Sun, 11 May 2003 14:50:54 -0400


Hi,

It ends up that Luis already had also written an 
iterator/iteratorWithIndex speed test.

Data: 390x390x390 region of an unsigned short image

memset
	Single Processor: 0.28
	Dual Processor:   0.25
scan using memory pointer in a 1D loop
	Single Processor: 0
	Dual Processor:   0
scan using memory pointer in 3 nested loops
	Single Processor: 0.18
	Dual Processor:   0.16
scan using iterator
	Single Processor: 0.36
	Dual Processor:   0.25
scan using iteratorWithIndex
	Single Processor: 1.15
	Dual Processor:   0.73

So, IteratorWithIndex is about 4x slower than the Iterator without an 
index.  HOWEVER, some of the difference is reduced with multi-processors 
(maintaining the index must parallelize well?).   On a dual processor 
machine the difference between iteratorWithIndex and Iterator is reduced 
to 3x.

Stephen
-- 
===============================================
Dr. Stephen R. Aylward
Assistant Professor of Radiology
Adjunct Assistant Professor of Computer Science
http://caddlab.rad.unc.edu
aylward@unc.edu
(919) 966-9695