Giter VIP home page Giter VIP logo

Comments (6)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
[deleted comment]

from rapidjson.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
I don't think it is possible to use a faster algorithm without ordering the 
keys.

Ordering the keys and putting them in a map also has a overhead so it is does 
not make sense to implement it.

Users should access a value once, then store it and re-use the value without 
calling Document::operator []. That will be faster than anything.

Original comment by [email protected] on 23 Jul 2013 at 9:28

from rapidjson.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
With C++11 it is possible to use std::unordered_map see e.g. 
http://en.cppreference.com/w/cpp/container/unordered_map

Original comment by [email protected] on 5 Nov 2013 at 10:00

from rapidjson.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Just my opinion…

AFAIK, hash-map overhead is known to be a lot heavier than sorted B-trees if 
key count is small. And JSON object usually expected to have a few of keys - 
less than 10 keys for example - because large number of keys means there's 
something wrong with data structure design.

So I doubt on using hash-map for performance. If your object has dozens of 
keys, it would make sense, but I never seen such JSON object.

IMO, binary search is the best approach for a JSON object, and C++11 std::map 
is usually intended to be a b-tree.

Original comment by [email protected] on 21 Dec 2013 at 4:57

from rapidjson.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024

Original comment by [email protected] on 20 Jun 2014 at 8:28

  • Changed state: WontFix

from rapidjson.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Added an analysis on this issue.
https://github.com/miloyip/rapidjson/issues/102

Original comment by [email protected] on 11 Aug 2014 at 5:32

from rapidjson.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.