3

I found a weird behaviour while decoding a JSON list into a native [(UTCTime, Double)]. The operation takes around 2 seconds for lists with 3K elements. I've been digging into the browser's performance report but I couldn't find a clear culprit.

I have also been testing how it behaves if I decode into other Datatypes and found that the time the operation takes is reduced by half if instead of UTCTime I use String.

Are those numbers normal? Is there a way to improve the times? I am using GHCJS 0.2.1.9 GHC 8.0.1 with lts-7.19.

Jesuspc
  • 1,664
  • 10
  • 25

1 Answers1

1

After using Aeson for a while, we switched to native JSON decoding in JavaScript where perf matters.

dysinger
  • 56
  • 2
  • detail: the way it works IIRC (it's been a year+) is that GHCJS receives the data, GHCJS calls JavaScript to decode something simple (like your big list). Way faster than Aeson for most things. Aeson is nice though when you don't have to worry about perf. – dysinger Sep 06 '17 at 21:20