Question
· Nov 6, 2024

Stream Compression Not Applied to Some Text

Hello Community,

I have a stream property which uses %Stream.GlobalCharacter and I set some dummy texts like "a1a2a3a4a5a6a7...."(more than 1024 characters)   in to that stream and the stream values are not compressed. However, The streams are compressed If I use the Lorem ipsum is a dummy or placeholder text or other text "This is part four of a long memo." which length is greater than 1024 

I opened the stream object and confirmed the compress property is 0 for first entry and  1 for 2nd object

Class Samples.Strms Extends %Persistent
{
Property MyId As %String;
Property MyBioStrm As %Stream.GlobalCharacter;
}

why the automatic stream Compression not applied for the first text

Thanks!

Product version: IRIS 2024.1
$ZV: IRIS for Windows (x86-64) 2024.1.1 (Build 347U) Thu Jul 18 2024 17:40:10 EDT
Discussion (3)2
Log in or sign up to continue

From Stream Compression documentation:

.....new stream data is automatically compressed, except for the following cases, where the data is not suitable for compression:

  • The stream can be stored in a single chunk less than 1024 characters long.
  • The stream is already compressed, that is, the first chunk of data matches a typical compressed file format, such as JPEG, MP3, or ZIP.
  • The first 4KB of the stream cannot be compressed by at least 20 percent.

I guess your test runs into these cases.