Technical experts from the IBM Transaction Processing Facility (TPF) Development Lab share knowledge and information about the TPF product set - including z/TPF, z/TPF Database Facility (z/TPFDF), TPF Operations Server, and the TPF Toolkit.
The developerWorks Connections Platform is now in read-only mode and content is only available for viewing. No new wiki pages, posts, or messages may be added. Please see our FAQ for more information. The developerWorks Connections platform will officially shut down on March 31, 2020 and content will no longer be available. More details available on our FAQ. (Read in Japanese.)
z/TPF support for zlib 1.2.11 and hardware accelerated compression (APAR PJ45872)
With the release of the IBM z15 processor, z/TPF can now compress and decompress data by using hardware acceleration. To support this, we have also upgraded our zlib support to version 1.2.11, and are now shipping zlib as a shared object.
By default, applications using zlib will perform compression and decompression by using the hardware acceleration, with exceptions based on specific criteria:
1) The _HZC_COMPRESSION_METHOD environment variable can be set to "software"
2) The initial buffer passed to a deflate / inflate API is smaller than 256 bytes
3) A software only strategy is used on deflate. Only Z_FIXED and Z_DEFAULT_STRATEGY can be used as deflate parameters with hardware compression.
The following zlib APIs can only be used if the zlib stream is in software mode:
When performing hardware accelerated compression, the compression performed might result in a larger size of data than a similar request performed by using software compression. There might be scenarios that prioritize space savings over compression time. For these scenarios, use one of the methods above to force zlib to use software compression for that use case.
In addition to hardware accelerated support for zlib, we are also introducing two z/TPF specific APIs which can be used to compress and decompress data by using the hardware acceleration only. These APIs will return a failure return code on systems not at z15 or later.
The tpf_compress and tpf_expand APIs provide a more direct interface to the hardware compression function, but are also less flexible. They are targeted to use cases where you do not require a compression header / trailer and also have the entire contents of the compressed data to expand, or the entire data you wish to compress, as well as buffers capable of handling the output.
We've observed significant performance savings by leveraging the hardware acceleration. Your performance and compression ratios will vary based on the input data contents and size.
size (in KB)
zlib software (usec)
zlib hardware (usec)
For more information about APAR PJ45872, see the APEDIT.