对OpenXLSX几个版本的编译和测试

I tested the new development-aral branch, the miniz version need g++ manually add libminiz.a

my steps

  1. copy the miniz-src and pugixml-src that automatically download by old verion of development-aral branch to deps
  2. build them use cmake and make
  3. 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
  1. run Scripts/make-gnu.sh to build the libzip version
  2. 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

  1. run Scripts/make-gnu.sh OPENXLSX_ENABLE_LIBZIP=OFF to 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

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值