pub const Options = struct good: u16Perform less lookups when a match of at least this length has been found.
nice: u16Stop when a match of at least this length has been found.
lazy: u16Don't attempt a lazy match find when a match of at least this length has been found.
chain: u16Check this many previous locations with the same hash for longer matches.
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299pub const Options = struct {
/// Perform less lookups when a match of at least this length has been found.
good: u16,
/// Stop when a match of at least this length has been found.
nice: u16,
/// Don't attempt a lazy match find when a match of at least this length has been found.
lazy: u16,
/// Check this many previous locations with the same hash for longer matches.
chain: u16,
// zig fmt: off
pub const level_1: Options = .{ .good = 4, .nice = 8, .lazy = 0, .chain = 4 };
pub const level_2: Options = .{ .good = 4, .nice = 16, .lazy = 0, .chain = 8 };
pub const level_3: Options = .{ .good = 4, .nice = 32, .lazy = 0, .chain = 32 };
pub const level_4: Options = .{ .good = 4, .nice = 16, .lazy = 4, .chain = 16 };
pub const level_5: Options = .{ .good = 8, .nice = 32, .lazy = 16, .chain = 32 };
pub const level_6: Options = .{ .good = 8, .nice = 128, .lazy = 16, .chain = 128 };
pub const level_7: Options = .{ .good = 8, .nice = 128, .lazy = 32, .chain = 256 };
pub const level_8: Options = .{ .good = 32, .nice = 258, .lazy = 128, .chain = 1024 };
pub const level_9: Options = .{ .good = 32, .nice = 258, .lazy = 258, .chain = 4096 };
// zig fmt: on
pub const fastest = level_1;
pub const default = level_6;
pub const best = level_9;
}
Trades between speed and compression size.
Default paramaters are [taken from zlib] (https://github.com/madler/zlib/blob/v1.3.1/deflate.c#L112)