Module comparison

Source
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 analysis
  • stats: Additional statistics for comparing groups

§Types

§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§

GroupComparisonMetrics
The statistics for a given group of fields. This can be a group created by the split_comparison module, the compare_groups module or any other piece of code that compares multiple sets of bytes.
GroupDifference
Represents the difference between 2 groups of fields. For the raw values of a single group, see GroupComparisonMetrics.