GithubHelp home page GithubHelp logo

Comments (6)

nieksand avatar nieksand commented on July 18, 2024

Correction.. only supports 63 keys given signed int64 the way bitwiseFlags is populated.

from jsonparser.

buger avatar buger commented on July 18, 2024

Yes it is, I have few ideas how to fix it without sacrificing performance.

On Wednesday, 20 July 2016, Niek Sanders [email protected] wrote:

Correction.. only supports 63 keys given signed int64 the way bitwiseFlags
is populated.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#56 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAA2uZbxpBvOxfZp3-ahA6iCyfMDhHoFks5qXar-gaJpZM4JQTF9
.


Sincerely yours Leonid Bugaev
http://gortool.com - test your system with real data

from jsonparser.

nieksand avatar nieksand commented on July 18, 2024

First off, thank you for writing and sharing this library! It's been incredibly helpful for a little project I'm working on.

A wishlist item that relates to the many key lookup issue...

I wish there was a way to iterate over a map and just have a callback invoked for each key/value pair:

func(key []byte, value []byte, dataType ValueType, err error)

For a many-key scenario like mine, I can just lookup the key in a Go map to see if it's interesting to me.

Similarly, if you just want to chomp through all the keys in the map, this avoids having to determine/specify the keys you care about up front.

from jsonparser.

nieksand avatar nieksand commented on July 18, 2024

I did a super-trashy hack implementation of my wishlist item above.

Before I invoked EachKey ~3 times per json payload to pull my data. (63 keys per call).

Now I use "WalkMap" once.

Overall performance of my app, which includes many things unrelated to json, went from 20K msgs/sec to 30k msgs/sec.

Before I was cpu-bound on json processing. Now I have free cpu and am bottlenecked elsewhere in my app.

Like I mentioned, the code is hacked garbage hence no PR.

But if you are curious it sits here: https://github.com/nieksand/jsonparser/blob/master/parser.go#L334

The actual change is here:
https://github.com/nieksand/jsonparser/blob/master/parser.go#L365

from jsonparser.

daboyuka avatar daboyuka commented on July 18, 2024

I've been thinking of prototyping this feature, as well. If I get some free
time over the next couple days I may look at your code and spin something
off of it for an actual PR.

On Jul 21, 2016 01:08, "Niek Sanders" [email protected] wrote:

I did a super-trashy hack implementation of my wishlist item above.

Before I invoked EachKey ~3 times per json payload to pull my data. (63
keys per call).

Now I use "WalkMap" once.

Overall performance of my app, which includes many things unrelated to
json, went from 20K msgs/sec to 30k msgs/sec.

Before I was cpu-bound on json processing. Now I have free cpu and am
bottlenecked elsewhere in my app.

Like I mentioned, the code is hacked garbage hence no PR. But if you are
curious it sits here:
https://github.com/nieksand/jsonparser/blob/master/parser.go#L334


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#56 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADvi_inTy6fvq0eF6D2AKhQ1xZb8G2BBks5qXv7qgaJpZM4JQTF9
.

from jsonparser.

nieksand avatar nieksand commented on July 18, 2024

Very cool.

I'm thinking it might be possible to rewrite EachKey to run on top of WalkMap. That would avoid the code duplication issue.

from jsonparser.

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.