danielgtaylor / jpeg-archive

Utilities for archiving JPEGs for long term storage.
1.16k stars 121 forks source link

Self-compiled Windows version of jpeg-recompress is significantly slower than GH release version #114

Closed ganego closed 4 years ago

ganego commented 4 years ago

Hi, I wanted to compile jpeg-recompress.exe myself. I went ahead and compiled mozjpeg according to the readme from jpeg-archive. I then compiled jpeg-archive. Everything compiled fine.

Problem: Using jpeg-recompress smallfry (did not test others), is significantly slower than the release build I can download from github. Compressing my test file, takes 31s instead of 19s.

I also tried compiling the 2.1.1 source from 2015 and got the same issue. Any ideas?

cmake for mozjpeg:

-- CMAKE_BUILD_TYPE = Release
-- VERSION = 4.0.0, BUILD = 20191225
-- 64-bit build (x86_64)
-- CMAKE_INSTALL_PREFIX = C:/Program Files (x86)/mozjpeg
-- CMAKE_INSTALL_BINDIR = bin (C:/Program Files (x86)/mozjpeg/bin)
-- CMAKE_INSTALL_DATAROOTDIR = share (C:/Program Files (x86)/mozjpeg/share)
-- CMAKE_INSTALL_DOCDIR = share/doc/mozjpeg (C:/Program Files (x86)/mozjpeg/share/doc/mozjpeg)
-- CMAKE_INSTALL_INCLUDEDIR = include (C:/Program Files (x86)/mozjpeg/include)
-- CMAKE_INSTALL_LIBDIR = lib (C:/Program Files (x86)/mozjpeg/lib)
-- Shared libraries enabled (ENABLE_SHARED = 1)
-- Static libraries enabled (ENABLE_STATIC = 1)
-- 12-bit JPEG support disabled (WITH_12BIT = 0)
-- Arithmetic decoding support enabled (WITH_ARITH_DEC = 1)
-- Arithmetic encoding support enabled (WITH_ARITH_ENC = 1)
-- TurboJPEG API library enabled (WITH_TURBOJPEG = 1)
-- TurboJPEG Java wrapper disabled (WITH_JAVA = 0)
-- Emulating libjpeg API/ABI v8.0 (WITH_JPEG7 = 0, WITH_JPEG8 = 1)
-- libjpeg API shared library version = 8.2.2
-- Compiler flags =
-- Linker flags =
-- INLINE = __inline__ __attribute__((always_inline)) (FORCE_INLINE = 1)
-- CMAKE_EXECUTABLE_SUFFIX = .exe
-- CMAKE_ASM_NASM_COMPILER = C:/Program Files/NASM/nasm.exe
-- CMAKE_ASM_NASM_OBJECT_FORMAT = win64
-- CMAKE_ASM_NASM_FLAGS =  -DWIN64 -D__x86_64__
-- SIMD extensions: x86_64 (WITH_SIMD = 1)
-- PNG reading support enabled (PNG_SUPPORTED = 1)
-- FLOATTEST = sse
-- Configuring done
-- Generating done
ganego commented 4 years ago

I found the issue: see "Compiler flags". Something missing... "-O3". I added it manually and it's now as fast as the release version. Seems I somehow screwed up my whole mozjpeg source with cmake for whatever reason - a new copy now added the right compiler flags.