MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / compression_ratio

Method compression_ratio

atomic-core/src/change/format_v3/chunking.rs:319–324  ·  view source on GitHub ↗

Returns the compression ratio (compressed / uncompressed). Returns `f64::NAN` if the uncompressed length is zero.

(&self)

Source from the content-addressed store, hash-verified

317 ///
318 /// Returns `f64::NAN` if the uncompressed length is zero.
319 pub fn compression_ratio(&self) -> f64 {
320 if self.chunk.length == 0 {
321 return f64::NAN;
322 }
323 self.compressed_data.len() as f64 / self.chunk.length as f64
324 }
325
326 /// Returns the space savings as a percentage (0.0 to 100.0).
327 pub fn space_savings_pct(&self) -> f64 {

Callers

nothing calls this directly

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected