-
-
Notifications
You must be signed in to change notification settings - Fork 410
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
New ultra-fast JSON Parser and Reader #3285
base: master
Are you sure you want to change the base?
Conversation
Tough I did suggest simdjson I was under the impression that it has writer functionality too. |
Okay, I can rewrite (parser Part) it using RapidJSON, no problem. |
May I ask? Have the point to do new functions? Or it's better to replace exists with breaking compatibility on new version? (Exists functions has bug from their implementation) |
As discussed earlier, we have decided to create an additional The other bugs, aside from returning as an array, have been fixed using the new parser. Link to the discussion: |
I'm closing the draft, so feel free to review. :) PR was compiled and tested on |
I'd advocate moving rapidjson to a submodule |
It looks like an universal way to make dependency. I like this idea
rapidjson is not under development ( last commit was 2 years ago ). I think we can keep sources in our repo. |
arguments.ReadFromJSONString(result.pData); | ||
{ | ||
if (arguments.ReadJSONString(result.pData)) | ||
arguments.PushArguments(arguments); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this line do? arguments.PushArguments(arguments)
looks strange
Generally, Git submodules are a matter of debate. They have their pros and cons. Certainly, for individuals who are inexperienced or starting their journey with coding and compiling project, it can cause a lot of trouble. The rapidjson repository is forked at this link; it was created two years ago during the creation of a pull request for discord-rpc. In the official rapidjson repository, the last commit was a month ago. I’d like us to make decisions about submodules together. |
Keeping sources in this repo makes PRs like this a mess. |
I’m aware that reviewing such a pull request with attached sources can be problematic and challenging to preview. I’ll try to move rapidjson to submodules today if I can and if permissions allow. Additionally, I’d like someone to check the permissions in advance because I can’t respond to reviews as they go into a pending status. |
I'd have to fork it into the mta org first I think, because premake has to be added. |
We have clone of rapidjson repository in MTA project already. |
Any updates on this? |
This pull request introduces a replacement of the "old" and collision-prone json-c library with rapidjson. Rapidjson is a memory-friendly library (each value occupies less than 16 bytes on 32/64-bit devices), it is fast and independent of external libraries, additionally accelerated by SSE2/SSE4.2 technology. All issues associated with the old JSON library have been resolved.
The old "json-c" library has been removed and replaced with the new one. The toJSON and fromJSON functions now include a parser and a reader, modified to maintain backward compatibility, as discussed on the "dev" channel on Discord.
New functions:
These functions have been added to the global json table and are accessible from there.
Example:
Performance Testing...
The data writing speed (using rapidjson) is currently, based on tests, approximately 100% faster than the current implementation. Similarly, for the parser.
In general, these results may vary and depend on the hardware used for testing. However, better hardware typically yields better results.
This pull request has been compiled and tested on the
Windows 10 x64
andLinux Debian 11 (ARM64)
platforms.Issues addressed and potentially resolved in this pull request:
#1946 #1931 #1073 #1074
Edited by replacing the simdjson parser with rapidjson.