{"action":"created","issue":{"url":"https://api.github.com/repos/playframework/playframework/issues/6800","repository_url":"https://api.github.com/repos/playframework/playframework","labels_url":"https://api.github.com/repos/playframework/playframework/issues/6800/labels{/name}","comments_url":"https://api.github.com/repos/playframework/playframework/issues/6800/comments","events_url":"https://api.github.com/repos/playframework/playframework/issues/6800/events","html_url":"https://github.com/playframework/playframework/pull/6800","id":195593550,"number":6800,"title":"Create ValidatorFactory just once","user":{"login":"mkurz","id":644927,"avatar_url":"https://avatars.githubusercontent.com/u/644927?v=3","gravatar_id":"","url":"https://api.github.com/users/mkurz","html_url":"https://github.com/mkurz","followers_url":"https://api.github.com/users/mkurz/followers","following_url":"https://api.github.com/users/mkurz/following{/other_user}","gists_url":"https://api.github.com/users/mkurz/gists{/gist_id}","starred_url":"https://api.github.com/users/mkurz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkurz/subscriptions","organizations_url":"https://api.github.com/users/mkurz/orgs","repos_url":"https://api.github.com/users/mkurz/repos","events_url":"https://api.github.com/users/mkurz/events{/privacy}","received_events_url":"https://api.github.com/users/mkurz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-12-14T17:24:52Z","updated_at":"2016-12-28T20:58:37Z","closed_at":"2016-12-15T12:54:16Z","pull_request":{"url":"https://api.github.com/repos/playframework/playframework/pulls/6800","html_url":"https://github.com/playframework/playframework/pull/6800","diff_url":"https://github.com/playframework/playframework/pull/6800.diff","patch_url":"https://github.com/playframework/playframework/pull/6800.patch"},"body":"Right now we create a `ValidatorFactory` **each time** we need a validator - which is quite often (for every constraint annotation for each request).\r\nBut we just need a single `ValidatorFactory` per app which delivers us the desired validator(s).\r\n\r\nAlso using `usingContext` isn't ideal here. What we do right now we create a `ValidationFactory` via `buildDefaultValidatorFactory` (which actually is just a shortcut for `.byDefaultProvider().configure().buildValidatorFactory()`) and then re-configure this just created factory via `usingContext()`. With my change we now immediately create the factory we want. \r\n\r\nThis change will save some CPU cycles and heap space :laughing: "},"comment":{"url":"https://api.github.com/repos/playframework/playframework/issues/comments/269539902","html_url":"https://github.com/playframework/playframework/pull/6800#issuecomment-269539902","issue_url":"https://api.github.com/repos/playframework/playframework/issues/6800","id":269539902,"user":{"login":"gmethvin","id":171663,"avatar_url":"https://avatars.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":"2016-12-28T20:58:36Z","updated_at":"2016-12-28T20:58:36Z","body":"We also should be checking for binary compatibility before merging (using `sbt mimaReportBinaryIssues`). I'll submit a PR with fixes."}}
{"actor":{"display_login":"gmethvin"}}