json data loading is very slow on larger objects
See original GitHub issueUsing json.loads() on larger objects (not very large, it’s enough to be aprox. 1 kB) is very slow. Looks like json module is using re, which causes this problem.
Trying to switch json to use _jsre, but this implementation is not working. json library is using match().end(), which returns different results for re and _jsre. Example:
>>> import re
>>> re.compile(" *").match(" test").end()
3
>>> import _jsre
>>> _jsre.compile(" *").match(" test").end()
1
Is it possible to fix this? Is _jsre still supported? Or is it possible to use process json differently? Also have no luck to use window.JSON.parse(), whcih returns hard to use JS objects.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to manage a large JSON file efficiently and quickly - Sease
In this blog post, I want to give you some tips and tricks to find efficient ways to read and parse a big...
Read more >JSON.stringify is very slow for large objects - Stack Overflow
I have a very big object in javascript (about 10MB). And when I stringify it, it takes a long time, so I send...
Read more >Processing large JSON files in Python without running out of ...
Loading complete JSON files into Python can use too much memory, leading to slowness or crashes. The solution: process JSON data one chunk ......
Read more >11 Ways to Improve JSON Performance & Usage - Stackify
1. You may need multiple JSON libraries for optimal performance and features · 2. Use streams whenever possible · 3. Compress your JSON...
Read more >Slow performance loading igGrid with large json data set
Hello,. I have a data set of 25,000 rows, 12 columns and for the table to load onto the page it takes about...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Javascripts objects such as JSON are intended to be used through the
javascript
module, which adds a layer to make them usable with Brython :They are also available as attributes of
window
(because thewindow
object in Javascript mixes everything from the Web API to language-specific names), but I will add a deprecation message suggesting to use thejavascript
module instead.May be an switch will be useful. Something like from future import …, just different names. Something what switches json.parse and other function to not fully compatible, but very fast mode. from brython import browser_json ?