-
- Downloads
ENH: Add otbStopwatch replacing itk::TimeProbe
The itk::TimeProbe constructor ends up calling itkResourceProbe::GetSystemInformation, which reads things like the hostname, the number of CPUs and so on. On Linux it parses /proc/cpuinfo for that information. OTB doesn't really need all those fields for a simple timer that's only used in a couple of places. This commit adds a replacement for that. As for the benchmarks, 100 000 instantiations of itk::TimeProbe take about 9.5 s on my computer. I suspect it's somewhat slower on a server with more CPUs. So this doesn't bring a huge performance improvement, but it might help in cases where a large number of high-resolution images are being read. The time for the same number of otb::Stopwatch instantiations is 4 ms. The context for this change is a project where we process time series of medium to high resolution images over large areas. The TimeProbe in otbGDALImageIO was sometimes showing in the profiles. A relevant discussion can be found at https://groups.google.com/d/msg/otb-developers/IvsFzSgRojo/0sMeEIZgCQAJ .
Showing
- Modules/Core/Common/include/otbStopwatch.h 85 additions, 0 deletionsModules/Core/Common/include/otbStopwatch.h
- Modules/Core/Common/src/CMakeLists.txt 2 additions, 1 deletionModules/Core/Common/src/CMakeLists.txt
- Modules/Core/Common/src/otbStopwatch.cxx 119 additions, 0 deletionsModules/Core/Common/src/otbStopwatch.cxx
- Modules/Core/Common/test/CMakeLists.txt 4 additions, 0 deletionsModules/Core/Common/test/CMakeLists.txt
- Modules/Core/Common/test/otbCommonTestDriver.cxx 1 addition, 0 deletionsModules/Core/Common/test/otbCommonTestDriver.cxx
- Modules/Core/Common/test/otbStopwatchTest.cxx 92 additions, 0 deletionsModules/Core/Common/test/otbStopwatchTest.cxx
Loading
Please register or sign in to comment