Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nodejs or/and webassembly binary ? #44

Closed
parweb opened this issue Feb 21, 2019 · 9 comments
Closed

nodejs or/and webassembly binary ? #44

parweb opened this issue Feb 21, 2019 · 9 comments

Comments

@parweb
Copy link

parweb commented Feb 21, 2019

Is it plan to export as nodejs or/and webassembly binary ?

@lemire
Copy link
Member

lemire commented Feb 21, 2019

Yes. WebAssembly is probably out for the time being, but a native node extension is something that ought to be done.

@parweb parweb closed this as completed Feb 21, 2019
@serv
Copy link

serv commented Feb 22, 2019

Say we have a working Node binding to simdjson.

In the readme, it reads:

Performance is optimized for JSON documents spanning at least a few kilobytes up to many megabytes: the performance issues with having to parse many tiny JSON documents or one truly enormous JSON document are different.

Does this mean that, this library would not be a suitable replacement for JSON.parse(jsonstring) in Node.js, where jsonstring is just a single line of JSON string?

@revskill10
Copy link

The issue is not resolved yet, why close then ?

@lemire
Copy link
Member

lemire commented Feb 22, 2019

Does this mean that, this library would not be a suitable replacement for JSON.parse(jsonstring) in Node.js, where jsonstring is just a single line of JSON string?

If you are parsing a single line of JSON, then it is unlikely that the time spent parsing is significant enough to warrant optimization unless you are parsing many, many such cases. And at that point, things like function call overhead and memory allocations are likely to dominate your running time. This is potentially interesting, but it is not something that this library was optimized for.

@kevyworks
Copy link

kevyworks commented Feb 22, 2019

In what size of json file we can expect the benefit? if that is known, I think it will switch in using this instead? but for me, as it is working best as a compiled binary..maybe a node script that Interface it using child_process is more suitable?

@parweb
Copy link
Author

parweb commented Feb 24, 2019

@parweb
Copy link
Author

parweb commented Feb 24, 2019

const [isOnline, setIsOnline] = add(users, isOnline(friend.id));

@lemire
Copy link
Member

lemire commented Feb 26, 2019

In what size of json file we can expect the benefit?

From the README: "Performance is optimized for JSON documents spanning at least a tens kilobytes up to many megabytes". This library (simdjson) is for processing large volumes of JSON.

@lemire
Copy link
Member

lemire commented May 14, 2020

My statement above were deliberately pessimistic: simdjson does very well even on tiny documents. At the time I wrote the above comments, I had not benchmarked simdjson on tiny documents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants