In case anyone is interested, I did some compiler and speed tests on Windows today using the latest sources in the develop branch and tested the G’MIC CLI.
Let’s start with the compilation stage:
First I compiled the sources using my MinGW/MSYS2 setup using the provided Makefile, no changes. This (unsurprisingly) spit out a gmic.exe that is about the same size as the latest official 2.9.4 binary - a bit over 10 MB. Of course this exe has dependencies on the 23 additional DLLs of the MinGW runtime environment, which clock in at 14+ MB, making the whole distribution package 24 files with around 25 MB in total.
I then compiled the sources with my Visual Studio 2019 solution with optimization enabled in MT mode (static linking of the Microsoft C++ runtime). The result was also around 10 MB for the exe, but this one is self-contained, meaning it does not need any additional DLLs to function, not even the Visual Studio or C/C++ runtime environment. The only thing it needs (since it was compiled with OpenMP enabled) is Windows’ own vcomp140.dll OpenMP library, which should be present on modern systems anyway.
All three files (the official binary, my MinGW/gcc one and my Visual Studio one) have the same featureset enabled (including CURL with https/SSL support, png, jpg, tiff, fftw3 and OpenMP) and seem to behave the same functionwise, so in the next step, I looked at the speed:
For this I used a heavy processing command (fx_stylize) and even applied it on a big 4K image to really put the system under stress:
gmic -tic -input 4k.bmp _fx_stylize starrynight +fx_stylize 1,6,0,0,0.5,2,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,10,2,1.85,0 -output 4k_out.bmp -toc
Well, the results took some time, as expected, but all three spit out a similar looking image with the style applied:
Concerning speed, on my 10-year old notebook, I ran each test 3 times with each of the three binaries, here are the averaged times for each:
Original CLI (MinGW/gcc): 672 seconds
My CLI (MinGW/gcc): 520 seconds
My CLI (VS 2019): 340 seconds
So interestingly, the Visual Studio version is (at least for this command and on my system) around twice as fast as the gcc one, while only being one third in size. Why my MinGW/gcc compiled binary was also almost 2 minutes faster than the original one - I have no idea.
In case anyone wants to test against my VS binary, I uploaded it here:
http://reduxfx.com/rtmp/gmic_cli_294_vs2019.zip