Ask Your Question

Revision history [back]

GaussianBlur in windows10 vs2017 and ubuntu g++ has different speed?

I use this code in windows and ubuntu

double start = cv::getTickCount();
cv::GaussianBlur(img_cont, edge_gau, Size(3, 3), 0.8);
cv::GaussianBlur(img_back, img_gau, Size(3, 3), 0.8);
double end = cv::getTickCount();
double time = (end - start) / cv::getTickFrequency();

in vs2017 Release and debug mode I open /openmp /fp:fast /sdl- /permissive- /Gy /Oi /arch:AVX2 /O2 /Ot /MD.

debug cost time: 0.02s

release cost time:0.005s

And opencv3.4.0 build in ubuntu 16.04:
cmake -D WITH_TBB=ON -D WITH_OPENMP=ON -D WITH_IPP=ON -D CMAKE_BUILD_TYPE=RELEASE -D BUILD_EXAMPLES=OFF -D WITH_NVCUVID=ON -D WITH_CUDA=ON -D BUILD_DOCS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF -D WITH_CSTRIPES=ON -D WITH_OPENCL=ON CMAKE_INSTALL_PREFIX=/usr/local/ ..

makefile: CXXFLAGS := -Wall -std=c++11 -O2 -fPIC

release cost time: 0.02s

so the time of release mode in ubuntu is almost equal to deubg mode in windows?