Determine whether an object is compressible #754
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#754
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently we use Content-Type attribute and check whether compressed slice is less than the original (thus reducing future read overhead).
This is because zstd does not have any "encodedLen"-like function.
However, this package can be useful https://github.com/klauspost/compress/blob/master/compressible.go#L10
Let's try to benchmark and compare.
This check should be a parameter of "compressor", maybe even put it in config. Defaults will depend on the benchmarks.
Determine whether the output is compressibleto Determine whether an object is compressibleTested on https://github.com/MiloszKrajewski/SilesiaCorpus bench data.
Results:
crypto/rand
resultsCan you also add results for the
crypto/rand
data here? We would like to have some threshold, it seems sth around 0.85 would be perfect.performance bench
goos: linux
goarch: amd64
pkg: git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/blobstor/compression
cpu: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
BenchmarkCompressionRealVSEstimate/estimate-8 1000000000 0.4262 ns/op 0 B/op 0 allocs/op
BenchmarkCompressionRealVSEstimate/compress-8 1 1122757487 ns/op 378271392 B/op 507 allocs/op
PASS
ok git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/blobstor/compression 11.916s
Done, in original message.