• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nlohmann / json / 34593111872
100%

Build:
DEFAULT BRANCH: develop
Ran 11 Sep 2026 12:50PM UTC
Jobs 1
Files 33
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

11 Sep 2026 11:15AM UTC coverage: 97.837% (-0.7%) from 98.52%
34593111872

push

github

web-flow
Add benchmarks for the binary readers (#5510)

The benchmark suite covered parsing JSON text, dumping, and serializing to
CBOR, but only one binary read: FromMsgpack. Nothing measured from_cbor,
from_ubjson, from_bjdata or from_bson, so a change to binary_reader.hpp had
no baseline to be compared against.

Add read benchmarks for every format, in the two shapes that matter: from a
contiguous buffer, which is what most callers pass, and from a FILE*, which
is what FromMsgpack already measures and which compiles to different code.
FromMsgpack itself is left untouched so its numbers stay comparable across
releases. The input is derived at setup time by serializing a parsed test
file, because the test data repository ships JSON only.

The test files are wide and shallow, but the readers' cost is per container,
so add three value shapes they do not cover -- deeply nested containers, many
sibling containers, and one flat array of numbers -- plus an indefinite-length
CBOR string, a form the writer never emits and which therefore has to be
assembled by hand. UBJSON and BJData are also captured in their size- and
type-annotated form, which the readers handle in a separate code path.

BSON requires an object at the top level, so it cannot reuse the array-rooted
test files; it is captured on the object-rooted ones, and the shapes are
wrapped in an object so every format measures the same value. The setup marks
the benchmark as skipped rather than letting the exception escape if that
requirement is ever violated.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

2579 of 2797 branches covered (92.21%)

7328 of 7490 relevant lines covered (97.84%)

15636594.17 hits per line

Coverage Regressions

Lines Coverage ∆ File
59
89.9
-7.82% include/nlohmann/detail/output/serializer.hpp
32
97.3
-0.17% include/nlohmann/detail/input/binary_reader.hpp
30
97.29
0.01% include/nlohmann/json.hpp
3
99.64
0.0% include/nlohmann/detail/output/binary_writer.hpp
2
99.37
-0.63% include/nlohmann/detail/input/json_sax.hpp
Jobs
ID Job ID Ran Files Coverage
1 34593111872.1 11 Sep 2026 12:50PM UTC 33
97.84
GitHub Action Run
Source Files on build 34593111872
  • Tree
  • List 33
  • Changed 6
  • Source Changed 6
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #34593111872
  • d2514a46 on github
  • Prev Build on develop (#34499229139)
  • Next Build on develop (#34619017593)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc