I recently evaluate the performance of OpenCV with asm.js.
Thanks to the OpenCV team, there are already lots of performance tests in each OpenCV module.
What I have done is that compile OpenCV library and its performance tests both in native and with asm.js.
Run the native performance test and the javascript performance test (with the Firefox javascript engine).
And the statistics data could be found in the following Google Sheet link:
https://docs.google.com/spreadsheets/d/1w8gr1_q_dQclTaGyiMtAhlwj_5_HPVKbHWfwUszPU40/edit?usp=sharing
In summary, there are about 20% tests are faster or equal to the native performance and about 60% tests are faster than 3x native performance.
Some patterns are observed.
First, tests with operations which convert floating point values into integer values are much slower.
Second, in native environment, single operation is much faster when it is dealing with integer type data comparing to dealing with floating point values;
however, in javascript environment, the same operation performs equally in each data type, which leads to relatively larger performance drop in non-floating point data type.
--
You received this message because you are subscribed to a topic in the Google Groups "emscripten-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/emscripten-discuss/uaRH2R62WOk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to emscripten-disc...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and all its topics, send an email to emscripten-discuss+unsub...@googlegroups.com.
Hello Kuo,
I am trying to compile OpenCV library in Emscripten using https://github.com/kakukogou/opencv/tree/opencvjs. I successfully completed the steps till:
emcmake cmake -DBUILD_CUDA_STUBS=OFF -DBUILD_DOCS=OFF
-DBUILD_EXAMPLES=OFF -DBUILD_JASPER=OFF -DBUILD_JPEG=OFF -DBUILD_OPENEXR=OFF -DBUILD_PERF_TESTS=OFF
-DBUILD_PNG=OFF -DBUILD_TBB=OFF -DBUILD_TESTS=OFF -DBUILD_TIFF=OFF
-DBUILD_WITH_DEBUG_INFO=OFF -DBUILD_ZLIB=OFF -DBUILD_opencv_apps=OFF
-DBUILD_opencv_ts=OFF -DBUILD_opencv_world=OFF -DWITH_1394=OFF -DWITH_CLP=OFF
-DWITH_CUBLAS=OFF -DWITH_CUDA=OFF -DWITH_CUFFT=OFF -DWITH_FFMPEG=OFF
-DWITH_GDAL=OFF -DWITH_GIGEAPI=OFF -DWITH_GSTREAMER=OFF
-DWITH_GSTREAMER_0_10=OFF -DWITH_GTK=OFF -DWITH_GTK_2_X=OFF -DWITH_JASPER=OFF
-DWITH_JPEG=OFF -DWITH_LIBV4L=OFF -DWITH_NVCUVID=OFF -DWITH_OPENCL=OFF -DWITH_OPENCLAMDBLAS=OFF
-DWITH_OPENCLAMDFFT=OFF -DWITH_OPENEXR=OFF -DWITH_OPENGL=OFF -DWITH_OPENMP=OFF
-DWITH_OPENNI=OFF -DWITH_OPENNI2=OFF -DWITH_PNG=OFF -DWITH_PVAPI=OFF
-DWITH_QT=OFF -DWITH_TBB=OFF -DWITH_TIFF=OFF -DWITH_UNICAP=OFF -DWITH_V4L=OFF
-DWITH_VTK=OFF -DWITH_WEBP=OFF -DWITH_XIMEA=OFF -DWITH_XINE=OFF
-DBUILD_SHARED_LIBS=ON -DBUILD_PACKAGE=ON -DCMAKE_COLOR_MAKEFILE=ON
-DWITH_EIGEN=ON -DCMAKE_BUILD_TYPE=RELEASE
-DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG -O3 -s PRECISE_F32=1
-Wno-warn-absolute-paths" -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-O3 -s
PRECISE_F32=1" -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG -O3 -s
PRECISE_F32=1" -DCMAKE_C_FLAGS_RELWITHDEBINFO="-O3 -s
PRECISE_F32=1" -DCMAKE_EXE_LINKER_FLAGS_RELEASE="-O3 -s PRECISE_F32=1"
-DCMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO="-O3 -g -s PRECISE_F32=1"
-DCMAKE_MODULE_LINKER_FLAGS_RELEASE="-O3 -s PRECISE_F32=1"
-DCMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO="-O3 -g -s PRECISE_F32=1"
-DCMAKE_SHARED_LINKER_FLAGS_RELEASE="-O3 -s PRECISE_F32=1"
-DCMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO="-O3 -g -s PRECISE_F32=1"
..
but
I am getting following error on ‘emmake make’:
[ 5%] Built target zlib
[ 5%] Generating opencl_kernels_core.cpp, opencl_kernels_core.hpp
Scanning dependencies of target opencv_core
[ 7%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/rand.cpp.o
In file included from /home/gunjan/Downloads/emsdk_portable/opencv/modules/core/src/rand.cpp:49:
In file included from /home/gunjan/Downloads/emsdk_portable/opencv/modules/core/src/precomp.hpp:55:
In file included from /home/gunjan/Downloads/emsdk_portable/opencv/modules/core/include/opencv2/core/private.hpp:58:
In file included from /usr/include/eigen3/Eigen/Core:263:
/usr/include/eigen3/Eigen/src/Core/arch/SSE/PacketMath.h:333:76: error: no matching function for call to '_mm_prefetch'
template<> EIGEN_STRONG_INLINE void prefetch<float>(const float* addr) { _mm_prefetch((const char*)(addr), _MM_HINT_T0); }
^~~~~~~~~~~~
/home/gunjan/Downloads/emsdk_portable/emscripten/master/system/include/emscripten/xmmintrin.h:129:1: note: candidate function not viable: no known conversion from 'const char *' to 'void *' for 1st
argument
_mm_prefetch(void
*__p, int __i)
Please refer the screenshot for additional information.
Any help in this regard would be greatly beneficial for my project. Please let me know if you need any other detail.
Thank you.
-Gunjan
--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscribe@googlegroups.com.