Contents - Index


Streamlining Your Application


 

  

If there are certain features of VCLZip/VCLUnZip that you know you don't need, it is possible to "streamline" things a little by removing support for some features and thereby removing the code and data that supports those features from your executable.  The table below shows you which conditionals to define in the project options dialog box in order to remove particular features: 

 

Define Conditional If you don't need support for  

NOSTREAMBUFF the additional speed of buffered file i/o 

INFLATE_ONLY earlier versions of PKZip decompression 

By defining MAKESMALL you can reduce the size of you application dramatically.  This removes all dependencies on the Dialogs, Forms, Controls, and FileCtrl units, which results in a smaller footprint.  This can be quite useful when putting VCLZip into a DLL for instance.  In order to make this work, go into your Project | Options and select the Directories/Conditionals tab and enter MAKESMALL in the conditional defines text box.  In Delphi you can add this conditinal define to the project options of your application that uses VCLZip and then do a "build all".  In BCB you will have to add this to the project options of the package that contains VCLZip and then rebuild the package. 

 

If you define MAKESMALL, the only things you lose are:

  

a) ZIP file open dialog box that appears when the ZipName is set to "?" 

b) Select Directory dialog box that appears when the DestDir is set to "?" 

c) Changing the cursor to an hour glass during some operations. 

 

By defining NO_RES, this avoids using the .RES file that contains strings that are used within VCLZip for things l like MessageBox messages.  Your strings will instead be compiled directly into the code.  This will ofcourse make it more difficult to internationalize you code and may result in poorer memory use, so you will most likely not want to define NO_RES.

  

By selecting the Asserts compiler option you will turn on some assert statements that have been added to the compression process.  In general you should never need these so you should be sure this isn't defined in order to maximize speed.  

 

Also, for speed purposes, be sure to turn off all error checking options like stack overflow and I/O checking. These kinds of options can slow down the zipping and unzipping processes quite a bit.