Faster JSON
Faster JSON
Is there any chance that a faster json parser is added to Ren'Py? Preferably one partly written in C (simplejson is almost identical to the original python one)?
- PyTom
- Ren'Py Creator
- Posts: 15893
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Faster JSON
We're currently using the Python json module, which is based on simplejson. As far as I know, this is partially written in C - we ship _json.so on Linux and Mac, and the _json module built-in to python27.dll on windows.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
-
Human Bolt Diary
- Regular
- Posts: 109
- Joined: Fri Oct 11, 2013 12:46 am
- Contact:
Re: Faster JSON
My first thought was "How slow can the default module be?" Turns out, pretty slow.
http://unethicalblogger.com/2009/12/04/ ... -town.html
http://brett.is/writing/about/fastest-p ... n-library/
https://pypi.python.org/pypi/ujson
Does Ren'Py use JSON enough to warrant another external dependency? Seems like using something on a per-project basis would be fairly painless.
http://unethicalblogger.com/2009/12/04/ ... -town.html
http://brett.is/writing/about/fastest-p ... n-library/
https://pypi.python.org/pypi/ujson
Does Ren'Py use JSON enough to warrant another external dependency? Seems like using something on a per-project basis would be fairly painless.
Re: Faster JSON
I know... python own module doesn't have C speedups... I don't think Ren'Py itself warrants an update but some games <coughs, mine, coughs> just might 
In any case, if it's not desirable, I'll look for other options (there always are). I couldn't figure out how to integrate C boosted module without recompiling Ren'Py (if at all possible obviously).
In any case, if it's not desirable, I'll look for other options (there always are). I couldn't figure out how to integrate C boosted module without recompiling Ren'Py (if at all possible obviously).
- PyTom
- Ren'Py Creator
- Posts: 15893
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Faster JSON
Python's module deos have C speedups. It didn't in 2006, but the current version does. (That's what _json.so is!)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
Re: Faster JSON
I wasn't aware of that... Thank you for the info, in this case it cannot be improved significantly with simplejson
Guess it's analyzing filename strings or cPickle for me then, I went with JSON for my game but as the amount of info got bigger and bigger, loading times became almost unacceptable. Both filenames and especially cPickle are a lot faster.
Who is online
Users browsing this forum: No registered users
