-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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: slow as hell #3809
Comments
"Now guess Nim's time" leads back to this page. Does it take 3809 seconds or something? |
This is a hover-spoiler 😄 |
Give us the test-json somehow. |
@Araq It's created by the test program. |
@Araq this is simplified test that exactly reproduces my case. I have a many key-value pairs in json format, approximately 2 Megabytes. You may also try this as test input: |
I had to download another web browser just to see it (on Android ATM). |
@kirbyfan64 I'm sorry this was simplest way to create spoiler on GitHub |
The problem is that a JObject's fields are a seq of key, val pairs. When you want to insert a new key it is checked for equivalence to each existing key. If I remove that one check it finishes in 0.2 seconds on my computer. I'll try to use a Table instead. |
@def- 0.2 - sounds good! |
Significant speedup for some operations, fixes nim-lang#3809 Not tested very well yet
Significant speedup for some operations, fixes nim-lang#3809 Not tested very well yet
Significant speedup for some operations, fixes nim-lang#3809 Not tested very well yet
I have a very BIG issue with loading ~2 MB json data. It looks like parsing time grows exponentially while increasing data size.
Here is python sample:
Now guess Nim's time:
The text was updated successfully, but these errors were encountered: