Hello,
I did it by building it by hand as I am not familar with the autobuild
toolchain. Therefore my scipts does the following steps with an
archive:
tar -zxf crcutil-1.0.tar.gz
cd crcutil-1.0
./configure --prefix=/usr/local
mkdir build
for i in code/*.cc ; do g++ -DHAVE_CONFIG_H -I. -
DCRCUTIL_USE_MM_CRC32=1 -Wall -msse2 -Icode -g -O3 -fomit-frame-
pointer -c -o build/`basename $i .cc`.o $i ; done
g++ -DHAVE_CONFIG_H -I. -Iexamples -Itests -
DCRCUTIL_USE_MM_CRC32=1 -Wall -msse2 -Icode -g -O3 -fomit-frame-
pointer -c -o build/interface.o examples/interface.cc
cd build
ar rcs libcrcutil.a *.o
cp libcrcutil.a /usr/local/lib
cd ..
cp code/*.h /opt/dedupv1/include
cp examples/interface.h /opt/dedupv1/include
cp tests/aligned_alloc.h /opt/dedupv1/include
ldconfig
This works for me.
I compared your CRC with the CRC of libcrypto. Therefore I created
100,000 messages of 2K size. with libcrypto this took me about 400 ms.
My first implementation with crcutil took 4 seconds, as I created each
time a new CRC object. This was no problem with libcrypto. After
changing this behaviour and using each time the same object I could do
10 100,000 messages in 75 ms with crcutil, libcrypto needed about the
same as before.
I am using crcutil in a multithreaded environment. So I have another
question: If I create a CRC, is it threadsafe? Or do I have to create
for each thread an own object?
bests
Sascha