1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Apache License, Version 2.0. See LICENSE.txt in the project root for license information.
* This software incorporates material from third parties. See NOTICE.txt for details.
*--------------------------------------------------------------------------------------------*/
pub struct PreflateParserConfig {
pub good_length: u32,
pub max_lazy: u32,
pub nice_length: u32,
pub max_chain: u32,
}
pub const FAST_PREFLATE_PARSER_SETTINGS: [PreflateParserConfig; 3] = [
PreflateParserConfig {
good_length: 4,
max_lazy: 4,
nice_length: 8,
max_chain: 4,
}, // max speed, no lazy matches
PreflateParserConfig {
good_length: 4,
max_lazy: 5,
nice_length: 16,
max_chain: 8,
},
PreflateParserConfig {
good_length: 4,
max_lazy: 6,
nice_length: 32,
max_chain: 32,
},
];
pub const SLOW_PREFLATE_PARSER_SETTINGS: [PreflateParserConfig; 6] = [
PreflateParserConfig {
good_length: 4,
max_lazy: 4,
nice_length: 16,
max_chain: 16,
}, // lazy matches
PreflateParserConfig {
good_length: 8,
max_lazy: 16,
nice_length: 32,
max_chain: 32,
},
PreflateParserConfig {
good_length: 8,
max_lazy: 16,
nice_length: 128,
max_chain: 128,
},
PreflateParserConfig {
good_length: 8,
max_lazy: 32,
nice_length: 128,
max_chain: 256,
},
PreflateParserConfig {
good_length: 32,
max_lazy: 128,
nice_length: 258,
max_chain: 1024,
},
PreflateParserConfig {
good_length: 32,
max_lazy: 258,
nice_length: 258,
max_chain: 4096,
}, // max compression
];