1 Feb 2013 11:06
Optimizing performance problems with Aeson rendering large Text arrays
Oliver Charles <ollie <at> ocharles.org.uk>
2013-02-01 10:06:19 GMT
2013-02-01 10:06:19 GMT
Hello,
In summary, i'm working on an application that responds to a users query, a
sequence index, with the union of a list of UUIDs that have "changed"
since that
same sequence index, split into 6 sections. I wish to respond to these
queries
via JSON to provide an easy to use web service, and for the most part,
what I
have works.
The problem I am having is that profiling seems to show that the
majority of the
time spent in my application is encoding this to JSON, and also that the
application is only 60% productive with 40% allocations happening in
Data.Aeson.encode (and friends).
Here's an overview of what I'm doing, the full code can be found at the
end of
this email.
I am storing my data in memory as an IntMap, from sequence index to a
changeset:
IntMap ChangeSet
Where a ChangeSet is essentially a tuple of HashSet's of UUIDs:
data ChangeSet = ChangeSet { artistChanges :: !(HashSet MBID)
, labelChanges :: !(HashSet MBID)
(Continue reading)
RSS Feed