Skip to content

2.1.0

Latest

Choose a tag to compare

@nickva nickva released this 23 Nov 23:52
· 2 commits to master since this release

What's Changed

Highlights

  • New {max_depth, N} decode option: decode only the top N levels and keep the rest as pre-encoded JSON that encodes back as is. This could help in routing setups (decode the top level, re-encode partial and forward to correct node, etc).
  • Decoding and encoding about 10-15% faster on average with bench
  • Decoding long strings is up to 3x faster, UTF-8 text 1.3x and numbers 1.2x
  • Small objects encode and decode about 4x faster: {"ok": true} now takes 145 ns to encode instead of 700 ns
  • Better yielding: a document that is one long string, pre-encoded values and bignums now count towards reductions, so they no longer hold a scheduler past its time slice. Under load, other processes waited about 220 ms behind decodes of a 27 KB string, now about 2 ms

PRs

  • Use size_t in more places in the decoder #306
  • Update ffc.h #307
  • Fix handling smallest 64bit integers #309
  • Switch to try ... catch ... end for OTP 29 by @jiahuili430 in #308
  • Use enif_term_type() in the encoder #310
  • Use enif_make_reverse_list for decoding arrays #311
  • Simplify decoder stack #312
  • Fast forward unescaped runs in the decoder #313
  • Add max_depth decode option #314
  • Lazy resource creation for faster small object encoding/decoding #315
  • Don't recycle buffers for every pre-encoded or bignum value #316
  • Improve reductions counting #317
  • Better accounting for pre-encoded values #318

Full Changelog: 2.0.2...2.1.0