4.102.0
json-io 4.102.0
Maven Central: com.cedarsoftware:json-io:4.102.0 (requires java-util 4.102.0+)
Highlights
Performance
- Float/double/BigDecimal/BigInteger parsing now backed by the Eisel-Lemire algorithm via java-util 4.102.0's vendored Randelshofer FastDoubleParser.
JsonParser/ToonReader/ObjectResolverroute through newMathUtilities.parse*entry points; output is bit-identical to JDK reference parsers. toMaps Read ratio 1.317x → 1.276x Jackson (-3.1%). JsonParser.readArray/readJsonObject— hand the already-read first character of the next value/field straight toreadValue(int, Type)/ newreadFieldName(int)instead of pushing it back and re-reading. Eliminates 3 read-then-pushback round-trips per non-trailing element/field (~17M pushbackgetfield/putfieldops per benchmark run). toJava Read -2.3%, toMaps Read -4.9%.ObjectResolver.traverseFields— adaptive shape cache: after 2 consecutive same-shape calls, builds a position-indexedFieldAssignmentPlan[]and skips the per-field HashMap lookup on subsequent same-shape objects. java-json-benchmark USERS DATABIND deser vs Jackson: 10KB 5.28x → 4.51x, 100KB 5.68x → 4.72x, 1MB 5.83x → 4.85x.JsonWriter.writeJsonUtf8String()— bulk-copies the input string into a per-threadchar[]via SIMD-intrinsicStringUtilities.getChars(), then walksbuf[i]instead ofs.charAt(i). WritecycleSupport=falsetoJava -2.14%, toMaps -2.40%.ToonWriter— replacedout.write(": ")/out.write(NEW_LINE)string-overload appends with single-char writes. TOON WritecycleSupport=falsetoJava -4.13%, toMaps -3.82%.Accessornow supports primitive getters for all eight Java primitive types; JSON/TOON writers use them to avoid boxing primitive POJO fields.JsonIo.toJson()/toToon()initialStringBuildercapacity 8192 → 32768; read-side injector planning caches field-assignment metadata;ToonReaderparses tabular rows directly from the borrowed line buffer;JsonIo.BufferRecyclertracks reader and pushback buffers independently.
Refactor
JsonObjectsplit into a shape-cut hierarchy — liteJsonObject(POJO / String-keyed map — public API) plus package-privateJsonObjectArray(@items-shaped) andJsonObjectMap(complex-keyed@keys/@items). LiteJsonObjectshed theObject[] itemsReffield andbyte storageMode— heap savings on every lite instance. Public API unchanged. NewJsonObjectFamilyTest(20 tests).
Bug fixes
- Borrowed
FastReader.BufferSlicecontent is now materialized or released at safe points, preventing buffer-overwrite edge cases during JSON string and TOON line parsing.
Full changelog: https://github.com/jdereg/json-io/blob/master/changelog.md