You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Benchmark: Might be worth including hyperjson and orjson #130
I think I might but the CI started failing today and a green CI would be a better base for a pull request to be merged in a green state. Any idea what macOS Travis is doing wrong?
PS: Regarding the benchmarks, I was trying PYTHONPATH=. make benchmarks-tables now but benchmarks/tablize.py will fail with KeyError: 'ujson' if I don't have ujson around. Getting ujson to run with recent Python 3 seems tricky, I first hit ultrajson/ultrajson#271 with 1.35 and then ultrajson/ultrajson#277 with its Git master:
@oleng The problem (and feature) with simdjson is that that it needs a CPU with AVX2 instructions, e.g. you cannot run the full benchmark on a Lenovo X220 laptop with an i5-2520M CPU:
# python -c 'import simdjson'Illegal instruction
At least that's how current pysimdjson wheels behave and pip install --no-binary pysimdjson{,} fails.
So then only people with AVX2 supporting CPUs can update python-rapidjson benchmarks. I'm not sure that's ideal.
Obviously I haven't mull around this for long, but that sounds to me more like it depends on the goal of releasing benchmark comparison than the amount of people with CPUs supporting AVX2, given that the latter has been around for 6+ years. Maybe if the goal is to provide complete picture of what's available now then it can be included, only with a caveat note?
Based on my own personal experience, I think people most likely seek/find the benchmark comparison because they want to know which external module/library can offer more/most performance for parsing JSONs because either it would help with increasing frequency of processing small/normal sized JSONs, or if not then they're dealing with non trivial amount of data in their JSON files. As anecdote, I noticed quite a bit of SO questions indicated they need ways to process gigabytes of JSON files with pandas, and pandas aren't memory efficient so loading big JSON into memory isn't possible/preferrable, but process/stream it in chunks is also tricky.
Activity
lelit commentedon Feb 20, 2020
Yes, it could be of some interest. Any chance you can offer a PR?
hartwork commentedon Feb 20, 2020
I think I might but the CI started failing today and a green CI would be a better base for a pull request to be merged in a green state. Any idea what macOS Travis is doing wrong?
hartwork commentedon Feb 20, 2020
PS: Regarding the benchmarks, I was trying
PYTHONPATH=. make benchmarks-tablesnow butbenchmarks/tablize.pywill fail withKeyError: 'ujson'if I don't have ujson around. Getting ujson to run with recent Python 3 seems tricky, I first hit ultrajson/ultrajson#271 with 1.35 and then ultrajson/ultrajson#277 with its Gitmaster:Do you have an easy way of getting ujson to work?
lelit commentedon Feb 21, 2020
I saw the failure, but I could not investigate further. I won't be able to switch focus to RJ until next week (reasonably).
lelit commentedon Feb 21, 2020
If that's the current state of affair, I'd consider removing it from the benchmarks...
hartwork commentedon Feb 21, 2020
I'm happy to get back to this when you're back.
I checked for ujson-based alternatives now. This is what I found:
hartwork commentedon Feb 21, 2020
PS: hyperjson would be about as interesting to add as orjson.
[-]Benchmark: Might be worth including orjson[/-][+]Benchmark: Might be worth including hyperjson and orjson[/+]slides: Add hyperjson and ujson-segfault to JSON decoders
lelit commentedon Feb 22, 2020
It seems I cured the problem, and now CI is green again!
hartwork commentedon Feb 23, 2020
Thanks for that!
oleng commentedon Feb 23, 2020
There's simdjson as well, written in C++ although I'm not sure about how the Python wrappers works as standard library replacement.
hartwork commentedon Feb 25, 2020
@oleng The problem (and feature) with simdjson is that that it needs a CPU with AVX2 instructions, e.g. you cannot run the full benchmark on a Lenovo X220 laptop with an i5-2520M CPU:
At least that's how current
pysimdjsonwheels behave andpip install --no-binary pysimdjson{,}fails.So then only people with AVX2 supporting CPUs can update python-rapidjson benchmarks. I'm not sure that's ideal.
oleng commentedon Feb 25, 2020
Obviously I haven't mull around this for long, but that sounds to me more like it depends on the goal of releasing benchmark comparison than the amount of people with CPUs supporting AVX2, given that the latter has been around for 6+ years. Maybe if the goal is to provide complete picture of what's available now then it can be included, only with a caveat note?
Based on my own personal experience, I think people most likely seek/find the benchmark comparison because they want to know which external module/library can offer more/most performance for parsing JSONs because either it would help with increasing frequency of processing small/normal sized JSONs, or if not then they're dealing with non trivial amount of data in their JSON files. As anecdote, I noticed quite a bit of SO questions indicated they need ways to process gigabytes of JSON files with pandas, and pandas aren't memory efficient so loading big JSON into memory isn't possible/preferrable, but process/stream it in chunks is also tricky.
Add orjson and hyperjson to the benchmarks and renew comparison tables
lelit commentedon Feb 29, 2020
orjsonis impressive indeed!hartwork commentedon Feb 29, 2020
… if we ignore the pain of installing it for a moment 😃
hyperjson and orjson have been added by a5ec68f now so I'll close this ticket as fixed.
PS: The updated
benchmarks-tables.rstcan be seen athttps://github.com/python-rapidjson/python-rapidjson/blob/616b91c84021f1a4ddd53e5d691fef6ff23178f7/docs/benchmarks-tables.rst .