KwikNet Virtual File System
K
DAK
245
File Compression
The VFS Generator can compress the files which make up your Virtual File System,
thereby reducing the memory required for your VFS image. The compression is done
using a simple text string replacement algorithm. This technique has been adopted
because the run-time file expansion is simple and fast. It is also especially suitable for
HTML files which contain frequently repeated HTML tags. Although other formal
binary compression algorithms may produce better compression, the VFS memory image
savings have to be dramatic just to recover the code and data space required by the file
expansion process. Furthermore, other compression utilities are available to compress
files (such as GIF images) before they are merged into your Virtual File System.
The VFS Generator can only compress the text strings which it finds in its VFS String
List. This list of strings can be defined by you in your VFS Definition File or in a
separate VFS String File. The KwikNet Virtual File System includes such a VFS String
File (KN_VFG.UVF) tailored specifically for HTML file compression.
As the VFS Generator encounters string matches during its creation of a VFS volume, it
adds the matched string to that volume's VFS Compression Table. Although there is no
limit to the number of compression candidate strings in your VFS String List, the VFS
Compression Table is limited to a maximum of 127 strings. Once the table is full,
compressions will be restricted to those strings already in the table.
Figure 7.2-3 illustrates the directives which are used to define strings for inclusion in the
VFS String List. For other examples, review the KwikNet VFS String File KN_VFG.UVF.
The ...STR directive is used to define case sensitive compression strings. Such strings
are inserted into the VFS String List exactly as defined.
The ...TAG directive is used to define compression strings whose case can be easily
adjusted using the ...TAGCASE directive. If the ...TAGCASE parameter is UPPER or
LOWER, any string defined using the ...TAG directive will be converted to upper or lower
case respectively prior to insertion in the VFS String List. If the ...TAGCASE parameter
is NONE, the ...TAG directive will be treated just like the ...STR directive. The tag
feature allows strings defined using any case, including mixed case, to be easily
converted to upper or lower case without having to edit the strings.
An exact match with strings in the VFS String List is required for a string to be
compressed. In this example, if a file contained the string "
Kwiknet", the string would
not be compressed. All occurrences of string "
<TABLE>" would be compressed but any
occurrence of string "
<TABLe>" would not.
...STR "KwikNet"
...STR "\r\n\r\n"
;
...TAGCASE UPPER
...TAG "<table>"
...TAG "<table "
...TAG "</table>
Figure 7.2-3 VFS Compression String Definition
Comments to this Manuals