3When used with the UTF-8 encoding performance improvements introduced
4in version 0.11.1.12 of the text package, this release improves
5aeson's JSON encoding performance by 33% relative to aeson 0.4.
7As part of achieving this improvement, an API change was necessary.
8The `fromValue` function in the `Data.Aeson.Encode` module now uses
9the text package's `Builder` type instead of the blaze-builder
10package's `Builder` type.
17function](http://hackage.haskell.org/packages/archive/aeson/latest/doc/html/Data-Aeson.html#v:decode)
18complements the longstanding `encode` function, and makes the API
21[New examples](https://github.com/bos/aeson/tree/master/examples) make
22it easier to learn to use the package.
27aeson's support for data-type generic programming makes it possible to
28use JSON encodings of most data types without writing any boilerplate
31Thanks to Bas Van Dijk, aeson now supports the two major schemes for
32doing datatype-generic programming:
34* the modern mechanism, [built into GHC
35 itself](http://www.haskell.org/ghc/docs/latest/html/users_guide/generic-programming.html)
37* the older mechanism, based on SYB (aka "scrap your boilerplate")
39The modern GHC-based generic mechanism is fast and terse: in fact, its
40performance is generally comparable in performance to hand-written and
41TH-derived `ToJSON` and `FromJSON` instances. To see how to use GHC
43[`examples/Generic.hs`](https://github.com/bos/aeson/blob/master/examples/Generic.hs).
45The SYB-based generics support lives in
46[Data.Aeson.Generic](http://hackage.haskell.org/packages/archive/aeson/latest/doc/html/Data-Aeson-Generic.html),
47and is provided mainly for users of GHC older than 7.2. SYB is far
48slower (by about 10x) than the more modern generic mechanism. To see
49how to use SYB generics, refer to
50[`examples/GenericSYB.hs`](https://github.com/bos/aeson/blob/master/examples/GenericSYB.hs).
53## Improved performance
55* We switched the intermediate representation of JSON objects from
57 [`Data.HashMap`](http://hackage.haskell.org/package/unordered-containers),
58 which has improved type conversion performance.
60* Instances of `ToJSON` and `FromJSON` for tuples are between 45% and
61 70% faster than in 0.3.
66This version of aeson makes explicit the decoupling between
67*identifying* an element of a JSON document and *converting* it to
69[`Data.Aeson.Parser`](http://hackage.haskell.org/packages/archive/aeson/latest/doc/html/Data-Aeson-Parser.html)
70documentation for details.
72The normal aeson `decode` function performs identification strictly,
73but defers conversion until needed. This can result in improved
74performance (e.g. if the results of some conversions are never
75needed), but at a cost in increased memory consumption.
77The new `decode'` function performs identification and conversion
78immediately. This incurs an up-front cost in CPU cycles, but reduces
79reduce memory consumption.
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list