News for hackers. Stuff that matters.
Re:The cost of parsing JSON by underwater on Wednesday September 18, 2019 @09:38PM (#21012397)
Why not use binary data? A typed array should work (unsure of the exact APIs, though).
Re:The cost of parsing JSON by helpmepropose on Sunday September 22, 2019 @09:28PM (#21045224)
Hey underwater, I just wanted to follow up and say thanks. Without doing any other optimization, it seems that switching the ajax request from JSON to a big TypedArray changed Chrome's parsing time from 18 seconds to instantaneous: https://helpmepropose.live

Thanks again!

Re:The cost of parsing JSON by helpmepropose on Thursday September 19, 2019 @08:44AM (#21015615)
That's a good idea, thanks! I'd previously thought typed arrays had to be initialized with data that's already in memory, but it looks like I was wrong there. This page is giving some hints that it can be done: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequ...