{"action":"created","issue":{"url":"https://api.github.com/repos/playframework/play-json/issues/69","repository_url":"https://api.github.com/repos/playframework/play-json","labels_url":"https://api.github.com/repos/playframework/play-json/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/playframework/play-json/issues/69/comments","events_url":"https://api.github.com/repos/playframework/play-json/issues/69/events","html_url":"https://github.com/playframework/play-json/pull/69","id":231208506,"number":69,"title":"Optimize object merging for common cases used in Json macros","user":{"login":"gmethvin","id":171663,"avatar_url":"https://avatars2.githubusercontent.com/u/171663?v=3","gravatar_id":"","url":"https://api.github.com/users/gmethvin","html_url":"https://github.com/gmethvin","followers_url":"https://api.github.com/users/gmethvin/followers","following_url":"https://api.github.com/users/gmethvin/following{/other_user}","gists_url":"https://api.github.com/users/gmethvin/gists{/gist_id}","starred_url":"https://api.github.com/users/gmethvin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmethvin/subscriptions","organizations_url":"https://api.github.com/users/gmethvin/orgs","repos_url":"https://api.github.com/users/gmethvin/repos","events_url":"https://api.github.com/users/gmethvin/events{/privacy}","received_events_url":"https://api.github.com/users/gmethvin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-05-25T00:31:33Z","updated_at":"2017-05-30T20:19:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/playframework/play-json/pulls/69","html_url":"https://github.com/playframework/play-json/pull/69","diff_url":"https://github.com/playframework/play-json/pull/69.diff","patch_url":"https://github.com/playframework/play-json/pull/69.patch"},"body":"The [functional combinators](https://www.playframework.com/documentation/2.6.x/ScalaJsonCombinators), which are also used by the JSON macros, suffer from some pretty serious performance issues because of the way they're constructed. For `Writes`, most of the time is spent constructing objects by merging `JsPath`s and merging in single-element objects, so I've optimized for those cases to get about a 5x speedup. I've also included some JMH benchmarks."},"comment":{"url":"https://api.github.com/repos/playframework/play-json/issues/comments/304996025","html_url":"https://github.com/playframework/play-json/pull/69#issuecomment-304996025","issue_url":"https://api.github.com/repos/playframework/play-json/issues/69","id":304996025,"user":{"login":"gmethvin","id":171663,"avatar_url":"https://avatars2.githubusercontent.com/u/171663?v=3","gravatar_id":"","url":"https://api.github.com/users/gmethvin","html_url":"https://github.com/gmethvin","followers_url":"https://api.github.com/users/gmethvin/followers","following_url":"https://api.github.com/users/gmethvin/following{/other_user}","gists_url":"https://api.github.com/users/gmethvin/gists{/gist_id}","starred_url":"https://api.github.com/users/gmethvin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmethvin/subscriptions","organizations_url":"https://api.github.com/users/gmethvin/orgs","repos_url":"https://api.github.com/users/gmethvin/repos","events_url":"https://api.github.com/users/gmethvin/events{/privacy}","received_events_url":"https://api.github.com/users/gmethvin/received_events","type":"User","site_admin":false},"created_at":"2017-05-30T20:19:42Z","updated_at":"2017-05-30T20:19:42Z","body":"@marcospereira I also added a test for lists. Seems like for a list of 100 elements it's a little more than 1/100 the speed, which makes sense. Here are more recent results:\r\n\r\n```\r\n[info] JsonMacros_01_SerializeSimpleCaseClass.toJson              thrpt   20  2123168.821 ±  51314.155  ops/s\r\n[info] JsonMacros_01_SerializeSimpleCaseClass.toJsonManualWrites  thrpt   20  3079308.057 ± 107394.814  ops/s\r\n[info] JsonMacros_02_SerializeList.toJson                         thrpt   20    15733.665 ±   1078.034  ops/s\r\n[info] JsonMacros_02_SerializeList.toJsonManualWrites             thrpt   20    29426.515 ±   1299.593  ops/s\r\n```"}}
{"actor":{"display_login":"gmethvin"}}