MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / GenerateCompressLevel

Function GenerateCompressLevel

internal/compressions/utils.go:98–108  ·  view source on GitHub ↗

GenerateCompressLevel 根据系统资源自动生成压缩级别

(minLevel int, maxLevel int)

Source from the content-addressed store, hash-verified

96
97// GenerateCompressLevel 根据系统资源自动生成压缩级别
98func GenerateCompressLevel(minLevel int, maxLevel int) (level int) {
99 if countCPU < 16 {
100 return minLevel
101 }
102
103 if countCPU < 32 {
104 return min(3, maxLevel)
105 }
106
107 return min(5, maxLevel)
108}
109
110// CalculatePoolSize 计算Pool尺寸
111func CalculatePoolSize() int {

Callers 4

newBrotliWriterFunction · 0.85
newDeflateWriterFunction · 0.85
newGzipWriterFunction · 0.85

Calls

no outgoing calls

Tested by 1