4.97.0
Highlights
- ToonReader performance optimization release — systematic hot-path improvements reducing per-line allocations, autoboxing, and field access overhead across the TOON parsing pipeline.
- Jackson test dependency updated from 2.19.4 to 2.21.1.
Performance
ToonReader.peekLine()— avoids materializing aStringfor blank, comment, and indent-only lines, reducing per-lineStringallocations by ~50%.ToonReader.cacheSubstring()— simplified to reduce code complexity and improve maintainability of the string caching layer.ToonReader.parseNumber()— integer fast path now avoids autoboxing by returning primitive values directly.JsonObject— index build deferred to first lookup instead of construction time;ToonReader.lineBuflocalized to reduce field access overhead.ToonReader.cacheSubstring()— inlined at hot call sites; frequently accessed fields (stringCache,classLoader) localized to reduce field dereference cost.ToonReader.readInlineObject()— char comparisons optimized;stringCachearray localized to a local variable in hot parsing methods.ToonReader— cache arrays (stringCache,numberCacheKeys,numberCacheValues) now reused across parse calls viaThreadLocal, eliminating per-parse array allocation.ToonReader.trimAsciiRange()— fast path that skips trim logic when the input range is already trimmed.ToonReader.parseNumber()— number cache arrays localized to reduce field access in the hot number-parsing loop.ToonReader.readInlineObject()— two separate indent checks merged into a single!=comparison.
Maintenance
- Update Jackson test dependency from 2.19.4 to 2.21.1; remove redundant
jackson-coreandjackson-annotationsdeclarations (pulled transitively viajackson-databind).
Install
Maven
<dependency>
<groupId>com.cedarsoftware</groupId>
<artifactId>json-io</artifactId>
<version>4.97.0</version>
</dependency>Gradle
implementation 'com.cedarsoftware:json-io:4.97.0'