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

Tencent / rapidjson / 2136 / 11
100%
master: 100%

Build:
Build:
LAST BUILD BRANCH: id-and-ref
DEFAULT BRANCH: master
Ran 12 Apr 2019 12:07AM UTC
Files 32
Run time 1s
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 Apr 2019 11:47PM UTC coverage: 99.866% (-0.06%) from 99.921%
CONF=debug ARCH=x86 CXX11=ON GCOV_FLAGS='--coverage'

Pull #1485

travis-ci

web-flow
Make use of an (std::multi)map for object members, if #defined.

When RAPIDJSON_USE_MEMBERS_MAP is defined, an object Value will store
its members in an (re)allocated array of Members like before, but also
in an std::multimap<StringRef,SizeType> where the key and value
reference the corresponding Member by its name and index in the array,
respectively, and in a relocatable manner.

The layout of the members map/array is now:
 {multimap}<>{capacity}<>{Member[capacity]}<>{multimap::iterator[capacity]}
where <> stands for the RAPIDJSON_ALIGN-ment of each part, if needed.

This layout needs to be reallocated when the current capacity is
exhausted, which requires to take care of the multimap and its iterators
explicitely; the former (likely not a POD) can simply be saved/restored
by swapping (twice), and the old/alive iterators must be moved to their
new offset (according to the new capacity).

With this in place, it's immediate to get the multimap::iterator from a
MemberIterator and vice versa, thus Find/Remove/EraseMember() working on
a MemberIterator keep the same complexity (O(1) for find/remove, and
still O(n-m) for EraseMember() due to the move/copy).

For operations by name, the lookups complexity switches from O(n)/linear
to the multimap's, usually rbtree's O(log n)/logarithmic, including for
AddMember() which without RAPIDJSON_USE_MEMBERS_MAP is otherwise O(1).

Consequently parsing will be slower, up to ~20% measured in perftests on
my laptop (since it's mainly composed of insertions). But later work on
the Document [usually the goal of parsing...] will be much faster; the
new DocumentFind perftest included in this commit is 8 times faster with
RAPIDJSON_USE_MEMBERS_MAP (still on my laptop). Overall the tests are 4%
slower (mainly composed of parsing), and notably 15% slower for schemas
parsing/validation (which supposedly comes from the larger JSON files
parsing, still). As a side note, when RAPIDJSON_USE_MEMBERS_MAP is not
defined, this commit ... (continued)
Pull Request #1485: Member map

5199 of 5206 relevant lines covered (99.87%)

997435.53 hits per line

Source Files on job 2136.11 (CONF=debug ARCH=x86 CXX11=ON GCOV_FLAGS='--coverage')
  • Tree
  • List 0
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 2078
  • Travis Job 2136.11
  • 3a565e0f on github
  • Prev Job for CONF=debug ARCH=x86 CXX11=ON GCOV_FLAGS='--coverage' on MemberMap (#2131.11)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc