2
LMCodes
7y

I think I hit the character limit in JSON.parse() but can't seem to find any documentation about it...

Comments
  • 0
    @hube first thing I tried, gets through the linters without an issue.
  • 1
    Tried to parse same string in any other language? Like Python, also how big is the string you are parsing?
  • 0
    @vividvilla didn't think to try that. In the end I just cut a couple of redundant fields on the json and it's happier now. I believe it was topping out around character 1570000 - this was in Javascript.
  • 1
    @LMCodes will try to reproduce that
  • 0
    @vividvilla Specifically it was Javascript in Firefox on Ubuntu 16.10 - if you can reproduce it I'd really like to hear!
  • 1
    Not saying there's no good reason for it or anything, but why such a long JSON string? Can you/does it make sense to do it maybe in batches or separate it or something?
  • 0
    @Bikonja I mean is laziness a good reason? :D in seriousness it's an internal tool for myself at work, I didnt want to sink too much time into it - hence editing the JSON to be about 1/2 the size by dropping some redundant-ish fields seemed the best solution in the end.
  • 0
    @LMCodes :) fair enough, if you compare my internal code and my commercial code it's a massive difference :) but hey, as long as it works :)
Add Comment