Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

Comprehensive Serialization Framework Comparison Tests #7

@expanded-for-real

Description

@expanded-for-real

Update current comparison tests to benchmark Imprint against common serialization frameworks, ranging from prolific general-purpose libraries (Jackson) to high-performance streaming formats (Protobuf, Avro).

Required Frameworks

Core Frameworks (Must Have)

  1. Protobuf - Google's high-performance binary format, widely used in microservices
  2. Avro - Apache's schema evolution-friendly format, popular in big data ecosystems
  3. Kryo - Fast Java serialization library, common in distributed systems
  4. Jackson JSON - De facto standard for JSON serialization in Java
  5. MessagePack (via Jackson) - Efficient binary JSON-like format
  6. FlatBuffers - Google's zero-copy serialization, direct competitor to Imprint's field access model
  7. FST - Fast Java serialization, popular drop-in replacement for Java serialization
  8. CBOR - Concise Binary Object Representation, standardized binary JSON alternative

Optional Frameworks (Nice to Have)

  1. Apache Thrift - Cross-language RPC framework with efficient serialization
  2. Apache Fury (formerly Fury) - JIT-optimized serialization framework
  3. Jackson with Blackbird - Jackson with bytecode generation for performance

Test Categories

1. Serialization Performance

  • Metric: Average time per operation (ns/op)
  • Goal: Measure write performance across frameworks
  • Expected: Imprint may be slower due to directory construction overhead

2. Deserialization Performance

  • Metric: Average time per operation (ns/op)
  • Goal: Measure read performance across frameworks
  • Expected: Imprint should excel due to O(1) field directory

3. Single Field Access Performance

  • Metric: Time to access field near end of record without full deserialization
  • Goal: Showcase Imprint's core value proposition
  • Expected: Imprint should significantly outperform competitors

4. Serialized Size Comparison

  • Metric: Bytes per serialized record
  • Goal: Compare storage efficiency
  • Expected: Binary formats (Protobuf, Avro) likely smallest

5. Merge/Update Operations

  • Metric: Time to merge two records and re-serialize
  • Goal: Test partial update scenarios
  • Expected: Imprint should be competitive due to selective field access

Test Data Characteristics

Data Characteristics

  • Field count: 20 fields total (7 core + 13 extra)
  • Record size: ~500-1000 bytes when serialized
  • Access pattern: Tests should access field 15+ to simulate "field near end" scenarios
  • Complexity: Mix of primitives, strings, collections, and nested data

Production-Like Configuration

Framework Setup Requirements

  • Protobuf: Use generated classes with proper schema definition
  • Avro: Use generic records with predefined schema, binary encoding
  • Kryo: Register classes, configure for production (no auto-registration)
  • Jackson: Standard ObjectMapper with default settings
  • MessagePack: Jackson with MessagePack factory
  • Thrift (optional): Use compact protocol, generated classes
  • Fury (optional): Configure for Java-only optimization

Test Environment

  • JVM Settings: Standard production JVM settings, sufficient heap
  • Warmup: Adequate JMH warmup iterations (3+ iterations, 1+ seconds each)
  • Measurement: Consistent measurement iterations (3+ iterations)
  • Threading: Single-threaded tests to avoid concurrency overhead

Implementation Notes

Dependencies

  • Add protobuf-gradle-plugin for schema compilation
  • Include all framework dependencies in JMH scope only (not main library)
  • Use compatible versions across frameworks

Metadata

Metadata

Labels

enhancementNew feature or request

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions