Class ParallelOptions
Namespace: Aspose.Zip.Saving
Assembly: Aspose.Zip.dll (25.2.0)
Options for parallel compression.
public class ParallelOptions
Inheritance
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Examples
using (var archive = new Archive())
{
archive.CreateEntries("DirToCompress");
archive.Save("archive.zip", new ArchiveSaveOptions() { ParallelOptions = new ParallelOptions { ParallelCompressInMemory = ParallelCompressionMode.Auto, AvailableMemorySize = 4000 } });
}
Remarks
These options manage simultaneous compression by several CPU cores.
Constructors
ParallelOptions()
public ParallelOptions()
Properties
AvailableMemorySize
Gets or sets memory estimate in megabytes available to accomodate compressed entries without swap to disk. This value only makes sense if Aspose.Zip.Saving.ParallelOptions.ParallelCompressInMemory setting is in Aspose.Zip.Saving.ParallelCompressionMode.Auto mode.
public int AvailableMemorySize { get; set; }
Property Value
Remarks
This value is used to calculate biggest size of entry that can be compressed in parallel with others. All entries above the calculated threshold will be compressed sequentially. It is safe to have Aspose.Zip.Saving.ParallelOptions.AvailableMemorySize property as big as free RAM and even bigger. By default it is assumed you have at least 200MB per CPU core.
ParallelCompressInMemory
Gets or sets value indicating how parallel approach to be used.
public ParallelCompressionMode ParallelCompressInMemory { get; set; }