{"issue":{"state":"open","pull_request":{"diff_url":"https://github.com/mailrank/aeson/pull/26.diff","html_url":"https://github.com/mailrank/aeson/pull/26","patch_url":"https://github.com/mailrank/aeson/pull/26.patch"},"user":{"avatar_url":"https://secure.gravatar.com/avatar/781a860767c303b371b43ad2ded00bef?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"781a860767c303b371b43ad2ded00bef","url":"https://api.github.com/users/basvandijk","login":"basvandijk","id":576355},"milestone":null,"assignee":null,"labels":[],"updated_at":"2011-10-29T19:02:30Z","closed_at":null,"comments":6,"url":"https://api.github.com/repos/mailrank/aeson/issues/26","body":"Hi Bryan,\r\n\r\nAs promised, here's the code for the new GHC generics implementations of the default `toJSON` and `parseJSON` methods.\r\n\r\nRegards,\r\n\r\nBas","html_url":"https://github.com/mailrank/aeson/issues/26","number":26,"title":"Use the new GHC generics for the default toJSON and parseJSON impl.","id":1697774,"created_at":"2011-09-21T13:43:49Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/781a860767c303b371b43ad2ded00bef?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"781a860767c303b371b43ad2ded00bef","url":"https://api.github.com/users/basvandijk","login":"basvandijk","id":576355},"updated_at":"2011-10-29T19:02:30Z","url":"https://api.github.com/repos/mailrank/aeson/issues/comments/2566309","body":"Hi Bryan,\r\n\r\nAs promised I add a criterion based benchmark suite which compares the different automatic `fromJSON`s and `toJSON`s. Below you'll find the result. `th` is the template-haskell, `syb` is the generic one using `Data` and `generic` is the generic one using the new GHC generics:\r\n\r\n```\r\n$ ./AesonCompareAutoInstances\r\nwarming up\r\nestimating clock resolution...\r\nmean is 3.741398 us (160001 iterations)\r\nfound 1742 outliers among 159999 samples (1.1%)\r\n  1554 (1.0%) high severe\r\nestimating cost of a clock call...\r\nmean is 803.1721 ns (23 iterations)\r\nfound 1 outliers among 23 samples (4.3%)\r\n  1 (4.3%) high severe\r\n\r\nbenchmarking toJSON/th\r\nmean: 6.020170 us, lb 5.996056 us, ub 6.062168 us, ci 0.950\r\nstd dev: 159.0150 ns, lb 106.7260 ns, ub 282.3435 ns, ci 0.950\r\n\r\nbenchmarking toJSON/syb\r\nmean: 31.54526 us, lb 31.42173 us, ub 31.70685 us, ci 0.950\r\nstd dev: 722.6885 ns, lb 578.7794 ns, ub 1.004215 us, ci 0.950\r\n\r\nbenchmarking toJSON/generic\r\nmean: 6.659639 us, lb 6.631286 us, ub 6.696389 us, ci 0.950\r\nstd dev: 164.8268 ns, lb 134.3246 ns, ub 231.8529 ns, ci 0.950\r\n\r\nbenchmarking fromJSON/th\r\nmean: 8.741088 us, lb 8.715038 us, ub 8.769778 us, ci 0.950\r\nstd dev: 139.8612 ns, lb 124.1566 ns, ub 159.6209 ns, ci 0.950\r\n\r\nbenchmarking fromJSON/syb\r\nmean: 22.53843 us, lb 22.46330 us, ub 22.64438 us, ci 0.950\r\nstd dev: 452.4726 ns, lb 349.4312 ns, ub 716.0150 ns, ci 0.950\r\n\r\nbenchmarking fromJSON/generic\r\nmean: 10.86662 us, lb 10.83148 us, ub 10.91113 us, ci 0.950\r\nstd dev: 201.6299 ns, lb 168.9015 ns, ub 278.3379 ns, ci 0.950\r\n```\r\n\r\nAs I expected, GHC generics is much faster than SYB.","id":2566309,"created_at":"2011-10-29T19:02:30Z"}}