These are chat archives for mdedetrich/scala-json-ast

8th
Jun 2016
Matthew de Detrich
@mdedetrich
Jun 08 2016 06:11
/@all Have just release 1.0.0-M2, it has removed the Javascript to Scala.js interopt, this blew up the file size of the final outputted JS and since its not optional I didn’t think it was fair to put a feature which I suspect no one will use that penalises everyone
@OlivierBlanvillain 1.0.0-M2 has just been released, and all of the @JsExport has been removed, let me know if it fixes the problem. Also unfortunately you are going to have to rebase against master for your pull request, when you do so let me know and I will release an 1.0.0-M3 with your addition
@eed3si9n Yeah, arrays are really fast. A lot of people don’t realise but when it comes to data structures, mutable ones are still a lot faster (even with the best comparisons) compared to immutable data structures. Using sized arrays would be even faster, but I am not sure if they are useful in context of Json parsing, @Ichoran maybe able to chime in on this one
Ichoran
@Ichoran
Jun 08 2016 19:56
@eed3si9n @mdedetrich - You can generally allocate arrays at a rate of GB/s, and transfer their contents also, so growing arrays (when the GC is pretty happy) is generally not a bottleneck when individual operations take more than a couple ns, which JSON parsing usually does. Also, unless you had some magical way to know how big the array ways, you'd have to go through the data matching brackets and stuff, which would probably be slower than just copying the array. It can be useful to keep a small reusable buffer for little arrays where the array object creation overhead can be significant, but I haven't bothered in Jsonal since the wins there are modest.
("Individual operations" meaning "how much work you have to do per element aside from managing your array".)