Expand description
Core comparison structures for storing the results of group comparisons.
The module is split into two specialized submodules:
split_comparison
: Easy comparison of ‘splitting’ structs.- e.g. interleaved (RGBRGBRGB) vs. separated fields (RRRGGGBB)
compare_groups
: Comparison of more custom field transformations and analysisstats
: Additional statistics for comparing groups
§Types
GroupComparisonMetrics
: Collects compression metrics (LZ matches, entropy, sizes)GroupDifference
: Tracks metric differences between two field groups
§Example
use struct_compression_analyzer::comparison::*;
use struct_compression_analyzer::analyzer::CompressionOptions;
fn calculate_example(baseline_data: &[u8], comparison_data: &[u8]) {
let options = CompressionOptions::default();
let baseline = GroupComparisonMetrics::from_bytes(&baseline_data, "name_a", options);
let comparison = GroupComparisonMetrics::from_bytes(&comparison_data, "name_b", options);
// Compare the difference
let difference = GroupDifference::from_metrics(&baseline, &comparison);
}
Modules§
- compare_
groups - Processes custom field transformations and group comparisons defined in schemas.
- split_
comparison - Analyzes compression efficiency of different field arrangements in bit-packed structures.
- stats
- Statistical functions for analyzing compression metrics.
Structs§
- Group
Comparison Metrics - The statistics for a given group of fields.
This can be a group created by the
split_comparison
module, thecompare_groups
module or any other piece of code that compares multiple sets of bytes. - Group
Difference - Represents the difference between 2 groups of fields.
For the raw values of a single group, see
GroupComparisonMetrics
.