Performant decoding of json values in GHCJS using Aeson

206 views Asked by At

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.

1

There are 1 answers

1
dysinger On

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