I tested the new development-aral branch, the miniz version need g++ manually add libminiz.a
my steps
- copy the
miniz-srcandpugixml-srcthat automatically download by old verion of development-aral branch todeps - build them use cmake and make
- set env variable
export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/par/libzip-1.11.4/lib:/par/openxlsx-dev-aral/deps/miniz-src:/par/openxlsx-dev-aral/deps/miniz-src/build:/par/openxlsx-dev-aral/deps/pugixml-src/src:/par/libzip-1.11.4/build
export LIBRARY_PATH=$LIBRARY_PATH:/par/libzip-1.11.4/build/lib:/par/openxlsx-dev-aral/deps/pugixml-src/build:/par/openxlsx-dev-aral/deps/miniz-src/build
export LD_LIBRARY_PATH=$LIBRARY_PATH
- run
Scripts/make-gnu.shto build the libzip version - run
time output/Demo5
the result time
real 0m46.800s
user 0m43.874s
sys 0m2.480s
the Demo05.xlsx file size 35,545,527
then remove the obj and ouput directories
- run
Scripts/make-gnu.sh OPENXLSX_ENABLE_LIBZIP=OFFto build the miniz version
it stoped at
g++ obj/Demo1.o output/libOpenXLSX.a -lpugixml -o output/Demo1
/usr/bin/ld: output/libOpenXLSX.a(XLZipArchive.o): in function `Zippy::ZipArchive::Open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
XLZipArchive.cpp:(.text._ZN5Zippy10ZipArchive4OpenERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN5Zippy10ZipArchive4OpenERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x3d): undefined reference to `mz_zip_reader_end'
...
make: *** [Makefile.GNU:332: output/Demo1] Error 1
I use g++ obj/Demo1.o output/libOpenXLSX.a -lpugixml /par/openxlsx-dev-aral/deps/miniz-src/build/libminiz.a -o output/Demo1 to build the Demo1. and then build Demo5 by
g++ -IOpenXLSX -IOpenXLSX/external -DUSE_LIBPUGIXML -fno-common -Wformat -Wformat-signedness -Wall -Wpedantic -Wextra -std=c++17 -IOpenXLSX/headers -IOpenXLSX/external/nowide -c Examples/Demo5.cpp -o obj/Demo5.o
g++ obj/Demo5.o output/libOpenXLSX.a -lpugixml /par/openxlsx-dev-aral/deps/miniz-src/build/libminiz.a -o output/Demo5
time output/Demo5
the result time
real 0m43.374s
user 0m39.906s
sys 0m2.609s
the Demo05.xlsx file size 35,604,025
the miniz version is faster and the file slightly bigger.
then I modified the Makefile.GNU, set OPTIMIZATION_FLAGS=-O3, repeat the last step
real 0m24.695s
user 0m20.844s
sys 0m2.400s
the Demo05.xlsx file size 35,604,190
I repeat the step 4 and 5 with OPTIMIZATION_FLAGS=-O3
real 0m35.927s
user 0m33.674s
sys 0m1.967s
the old OpenXLSX-development-aral version build with cmake and make
real 0m19.537s
user 0m15.108s
sys 0m2.485s
the master version build with Scripts/make-gnu.sh and OPTIMIZATION_FLAGS=-O3
real 0m15.498s
user 0m12.858s
sys 0m2.305s
the Demo05.xlsx file size 35,606,933
so, both the new and old OpenXLSX-development-aral version still are slower than the master
6638

被折叠的 条评论
为什么被折叠?



