[Zlib-devel] zlib1.dll

Gilles Vollant info at winimage.com
Mon Sep 29 07:34:07 EDT 2003


 
I compiled the DLL with C
http://www.winimage.com/zLibDll/zlib-1207-dll-testvc7.zip

There is two version of the DLL in zipfile :

1) without assembly code (noasm directory of zipfile):
I just uncompress zlib-1.2.0.7.tar.gz in a directory and run
nmake -f win32\Makefile.msc LOC="-G6" LDFLAGS="-opt:nowin98 -release"

2) with assembly code (asm directory of zipfile)
I uncompress zlib-1.2.0.7.tar.gz in a directory and run
copy contrib\vstudio\vc7\*.obj
copy contrib\masmx86
nmake -f win32\Makefile.msc LOC="-G6" LDFLAGS="-opt:nowin98 -release"

Now, the better thing to do is compare VC6 and VC7.1, with and without
assemble code in several CPU
(Pentium MMX, Pentium II, Pentium III, Pentium 4, AMD K6, AMD Duron, AMD
Athlon...)

-----Message d'origine-----
De : Zlib-devel-bounces at madler.net [mailto:Zlib-devel-bounces at madler.net] De
la part de Cosmin Truta
Envoyé : mercredi 24 septembre 2003 01:55
À : Zlib-devel at zlib.net; png-implement at ccrc.wustl.edu;
mng-list at ccrc.wustl.edu
Objet : [Zlib-devel] zlib1.dll


Mark Adler wrote:

> The last version of zlib before 1.2.1 is available here:
>
>     http://www.alumni.caltech.edu/~madler/zlib-1.2.0.7.tar.gz

Given that the new release is at the door, I prepared a DLL
distribution:

  http://www.cs.toronto.edu/~cosmin/pngtech/zlib/zlib-1207-dll.zip

Gerard advised that a DLL distribution should always be available, to reduce
(eliminate?) the need for private builds.

In the zlib FAQ it is written that the DLL can be downloaded from the zlib
site. Therefore, each time there is a new zlib release, somebody has to
synchronize with Mark and make the DLL release at the same time, or shortly
after.

I am volunteering for this task. As a test, I prepared zlib-1207-dll, built
from the 1.2.0.7 release candidate.

I must tell you, however, that I only have Visual C++ 6.0 and MinGW-3.0
(gcc-3.2.3). Gilles Vollant pointed out that Visual C++ 7.0 and 7.1 optimize
the code for PIII, but I don't have VC7, and I don't plan to buy it any time
soon. If you have it, and are willing to provide the zlib1.dll builds
yourself, write me. You don't have to write docs, because I did it already
(they're in the zlib-1207-dll distribution).

You'll only have to:
 1. Build the DLL from the unaltered sources, as provided by Mark;  2.
Update the zlib version number in README.txt  3. Make an archive and send it
to Mark, to be put in the zlib www site.

**

I will write some performance considerations below, based on my testing on
an AMD Duron 900MHz and Win2k.

- I noticed no performance difference between zlib1.dll as compiled with
Microsoft C vs. MinGW (no ASM). When using gcc, I disabled the frame
pointers (-fomit-frame-pointer)

- Inlining did *not* prove to be beneficial. I noticed very, very minor
performance decreases (1-2%) when I built zlib with inlining, both with
Microsoft C (with /Ob2) and with gcc (-O3 vs. -O2). Maybe this difference
was caused by the OS overhead, but even in this case, the lesson is that
zlib should be compiled without inlining.

- The ASM deflation code (ASMV) provided little benefit, around 2-3%.

- The ASM inflation code (ASMINF) provided a considerable benefit, over 20%.

The tests were run many times, and the outcomes were averaged (except the
first one, which was discarded to eliminate the impact of loading the data
into the cache).


Best regards,
Cosmin





More information about the Zlib-devel mailing list