Skip to the content.

This directory contains comprehensive compression tests and benchmarks for slimjson.

Structure

testing/
├── fixtures/              # Test JSON files
│   ├── resume.json       # 28KB - Complex resume with nested data
│   ├── schema-resume.json # 25KB - Schema.org resume format
│   └── users.json        # 5KB - Simple user list
├── compression_benchmark.go # Compression testing tool
├── run_tests.sh          # Test runner script
└── README.md            # This file

Running Tests

Quick Start

./run_tests.sh

Manual Execution

go run compression_benchmark.go

Test Files

resume.json (28.2 KB)

Complex resume with deep nesting, arrays, and various data types. Tests real-world JSON structure handling.

schema-resume.json (24.8 KB)

Schema.org compatible resume format with semantic markup. Tests structured data compression.

users.json (5.5 KB)

Simple user list from JSONPlaceholder API. Tests basic array and object compression.

Compression Profiles

The test suite evaluates four compression profiles:

Light Compression

Medium Compression

Aggressive Compression

AI-Optimized Compression

Output Format

The test tool provides:

  1. Detailed Results: Per-file, per-config compression metrics
  2. Markdown Table: Ready-to-use table for documentation
  3. Processing Time: Performance metrics with statistical analysis
    • Mean processing time
    • Standard deviation (±σ)
    • Number of iterations (n=10)

Statistical Analysis

Each test runs 10 iterations to ensure reliability:

Lower standard deviation indicates more consistent performance.

See METHODOLOGY.md for detailed statistical methodology.

Adding New Test Files

  1. Place JSON file in fixtures/ directory
  2. Run ./run_tests.sh
  3. Results will automatically include the new file

Performance Considerations

Integration with CI/CD

Add to your CI pipeline:

- name: Run compression tests
  run: |
    cd testing
    ./run_tests.sh

Benchmarking

For detailed performance benchmarks, run from the project root:

go test -bench=. -benchmem -benchtime=3s

See slimjson_bench_test.go for benchmark implementations.