Skip to content

4.102.0

Choose a tag to compare

@jdereg jdereg released this 06 Jun 15:16
· 180 commits to master since this release

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/ObjectResolver route through new MathUtilities.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 to readValue(int, Type) / new readFieldName(int) instead of pushing it back and re-reading. Eliminates 3 read-then-pushback round-trips per non-trailing element/field (~17M pushback getfield/putfield ops per benchmark run). toJava Read -2.3%, toMaps Read -4.9%.
  • ObjectResolver.traverseFieldsadaptive shape cache: after 2 consecutive same-shape calls, builds a position-indexed FieldAssignmentPlan[] 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-thread char[] via SIMD-intrinsic StringUtilities.getChars(), then walks buf[i] instead of s.charAt(i). Write cycleSupport=false toJava -2.14%, toMaps -2.40%.
  • ToonWriter — replaced out.write(": ") / out.write(NEW_LINE) string-overload appends with single-char writes. TOON Write cycleSupport=false toJava -4.13%, toMaps -3.82%.
  • Accessor now supports primitive getters for all eight Java primitive types; JSON/TOON writers use them to avoid boxing primitive POJO fields.
  • JsonIo.toJson() / toToon() initial StringBuilder capacity 8192 → 32768; read-side injector planning caches field-assignment metadata; ToonReader parses tabular rows directly from the borrowed line buffer; JsonIo.BufferRecycler tracks reader and pushback buffers independently.

Refactor

  • JsonObject split into a shape-cut hierarchy — lite JsonObject (POJO / String-keyed map — public API) plus package-private JsonObjectArray (@items-shaped) and JsonObjectMap (complex-keyed @keys/@items). Lite JsonObject shed the Object[] itemsRef field and byte storageMode — heap savings on every lite instance. Public API unchanged. New JsonObjectFamilyTest (20 tests).

Bug fixes

  • Borrowed FastReader.BufferSlice content 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