-
Notifications
You must be signed in to change notification settings - Fork 258
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
JSON with low memory consumption #232
Comments
The provided example reads from the file, not the memory. Please update it (or even better, send PR) with the code that reads into the memory first, and parse the JSON from the memory. The overall time could increase, but the measured time interval (for the actual JSON parsing) could decrease. |
I see, would you be interested to PR instead? |
Yes, please. As a guide, the PR for the new tests usually includes:
|
Sorry, haven’t have the time to follow up, I hope you could PR? |
PR #236 - Please note that is has bigger memory consumption because it reads the file from the memory (as all other tests), not from the file system directly. As for the performance, it doesn't beat other Go tests, but rather it's the slowest among them, so I have some doubts about including it into the benchmarks. However, if you wish, I'll merge the PR into master. |
In my opinion, if this can indicate as "read file from OS" or a separate JSON benchmark, otherwise, we can ignore the PR. |
I recently noticed this issue and made some improvements and it is now faster and more efficient using avarage 5mb memory. It could be improved more but for now probably enough. It doesn't needed jsparser in your benchmarks but want to add few comments, Most of the exisiting libraries including Your benchmark counts total memory usage if you taken into acount avarage memory usage then I impressed |
Even if you use memory mapping, which is essentially streaming, and doesn't really use much memory if it isn't there, as it relies on the OS paging, the measurement looks very similar with the measurement being done, at least a few months ago. Another approach might be to take the memory prior to parsing after the file has been loaded as this will show parsing memory which seems like the goal. |
Just tried with jsparser, I realise it consume lowest memory possible, less than 9MB, probably avoid extra allocation iirc.
macOS Catalina
Go version 1.14rc1
Timing to complete: <2.2s
Memory: <9MB
The text was updated successfully, but these errors were encountered: