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

View Source

Phase 2 Optimization: String Building with IO Lists

This module provides optimized versions of Layer 3 functions that use IO lists instead of string concatenation to achieve O(n) performance instead of O(n²).

Key optimizations:

  • Replace result <> char with [result, char]
  • Use IO.iodata_to_binary/1 only at final result
  • Maintain identical API and behavior

Summary

Functions

Optimized version of quote_unquoted_keys using IO lists.

Functions

quote_unquoted_keys_iolist(input)

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

Optimized version of quote_unquoted_keys using IO lists.

This replaces the quadratic result <> char pattern with O(1) IO list operations.