JsonRemedy.Layer3.Optimized.BinaryParser (json_remedy v0.1.3)

View Source

Phase 3 Optimization: Binary Pattern Matching + IO Lists

This module combines both optimizations:

  • IO lists for O(1) string building
  • Binary pattern matching for O(1) character access

Expected improvement: 50x+ for large inputs

Summary

Functions

Optimized normalize_literals using binary pattern matching.

Single-pass optimization that combines quote normalization and literal replacement. This is the ultimate optimization - one pass through the binary doing everything.

Optimized quote_unquoted_keys using binary pattern matching and IO lists.

Functions

normalize_literals_optimized(input)

@spec normalize_literals_optimized(binary()) :: {binary(), [map()]}

Optimized normalize_literals using binary pattern matching.

normalize_syntax_single_pass(input)

Single-pass optimization that combines quote normalization and literal replacement. This is the ultimate optimization - one pass through the binary doing everything.

quote_unquoted_keys_optimized(input)

@spec quote_unquoted_keys_optimized(binary()) :: {binary(), [map()]}

Optimized quote_unquoted_keys using binary pattern matching and IO lists.