l8srlz

Serialization

High-performance cross-platform object serialization.

Overview

L8SRLZ is a cross-platform binary serialization library for microservices. It handles Go and Java, integrates with Protocol Buffers, supports query-based selective serialization, and includes replica tracking for distributed systems.

Serialization Format

Each value is prefixed with its reflect.Kind as an int32 (4 bytes), enabling type identification during deserialization without prior schema knowledge. Buffers start at 1,024 bytes and double as needed to minimize allocations.

Supported Types

Primitives

Integers: int, int32, int64, uint32, uint64
Floating point: float32, float64
Text: string with length-prefixed encoding
Boolean: bool
Byte: single byte (uint8)

Complex Types

Structs: Protocol Buffers message serialization
Collections: Slices and arrays with type preservation
Maps: Key-value collections with type inference
Pointers: Automatic dereferencing with null safety

Core Components

Object Engine
Main serialization engine with automatic buffer management
Elements Container
Multi-object container with query support and error handling
Type Handlers
Specialized serializers per primitive and complex type
Registry System
Dynamic type resolution for deserialization
Replica System
Replica number tracking for distributed data

Features

L8QL query language integration for selective serialization
Base64 encoding for network transmission
Notification system for event-driven workflows
List conversion for typed collections
Page-based processing for streaming workloads
Statistics integration for performance monitoring

Performance

2-4x faster than standard serialization approaches
50-70% reduction in memory allocations
Microsecond-level latency for primitive types
Linear scaling with object complexity

Testing

30+ tests covering all primitive types, collections, maps, Protocol Buffers messages, Elements container operations, list conversion, error handling, and notifications.