On Sun, Sep 2, 2012 at 4:24 PM, Bradley Lowekamp <[email protected]> wrote: > > Hello David, > > Is the code you use to profile this available? > > Little bit of code like this can be very compiler and architecture dependent. There is a lot of potential optimization. Even the way you convert/round the result of the method to the integer your assigning it to can make a big difference, you could look at the round methods in the itk::Math namespace. > > Also what architecture and sse instruction sets are you compiling for? x64 arch? > > Brad
Hi Brad, Here is a demo (previously I had put this function actually in the itkCovariantVector class, but this way seemed easier for a demo and I don't think it changes anything): https://github.com/daviddoria/ITKTimingDemos/blob/master/SquaredNorm/SquaredNorm.cpp I am compiling with g++ 4.6.3. Using these flags: -O3 and -03 -msse2 seems to produce the same timings: Built in time: 3.049 Custom time: 2.00261 Those are the only compiler flags I was passing - would it help to explicitly specify an architecture? I am using a 32bit system. David
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://www.itk.org/mailman/listinfo/insight-developers
