{"action":"created","issue":{"url":"https://api.github.com/repos/ocpsoft/rewrite/issues/192","labels_url":"https://api.github.com/repos/ocpsoft/rewrite/issues/192/labels{/name}","comments_url":"https://api.github.com/repos/ocpsoft/rewrite/issues/192/comments","events_url":"https://api.github.com/repos/ocpsoft/rewrite/issues/192/events","html_url":"https://github.com/ocpsoft/rewrite/issues/192","id":51102471,"number":192,"title":"Huge performance impact when using many @Parameter resulting in large nested conditions","user":{"login":"torgre","id":7633441,"avatar_url":"https://avatars.githubusercontent.com/u/7633441?v=3","gravatar_id":"","url":"https://api.github.com/users/torgre","html_url":"https://github.com/torgre","followers_url":"https://api.github.com/users/torgre/followers","following_url":"https://api.github.com/users/torgre/following{/other_user}","gists_url":"https://api.github.com/users/torgre/gists{/gist_id}","starred_url":"https://api.github.com/users/torgre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torgre/subscriptions","organizations_url":"https://api.github.com/users/torgre/orgs","repos_url":"https://api.github.com/users/torgre/repos","events_url":"https://api.github.com/users/torgre/events{/privacy}","received_events_url":"https://api.github.com/users/torgre/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2014-12-05T14:10:21Z","updated_at":"2015-01-07T07:26:26Z","closed_at":null,"body":"Create a class with a simple ```@Join(path = \"/mypage\", to = \"/mypage.jsf\")``` on class level. Then use n ```@Parameter``` annotations.\r\n\r\n```java\r\n    @Parameter\r\n    @Deferred\r\n    @IgnorePostback\r\n    private String test01;\r\n\r\n    @Parameter\r\n    @Deferred\r\n    @IgnorePostback\r\n    private String test02;\r\n\r\n    [...]\r\n\r\n    @Parameter\r\n    @Deferred\r\n    @IgnorePostback\r\n    private String test09;\r\n```\r\n\r\nThe performance for a simple AJAX post request on this page degrades drastically. Debugging Rewrite, I found the Condition in the method ```org.ocpsoft.rewrite.config.RuleBuilder.evaluate(Rewrite, EvaluationContext)``` to have the following ```toString()``` output.\r\n\r\n```\r\n.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test03\", \"{test03}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True())))).and(RequestParameter.matches(\"test03\", \"{test03}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test04\", \"{test04}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True())))).and(RequestParameter.matches(\"test03\", \"{test03}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test03\", \"{test03}\").or(new True())))).and(RequestParameter.matches(\"test04\", \"{test04}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test05\", \"{test05}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True())))).and(RequestParameter.matches(\"test03\", \"{test03}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test03\", \"{test03}\").or(new True())))).and(RequestParameter.matches(\"test04\", \"{test04}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test03\", \"{test03}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True())))).and(RequestParameter.matches(\"test03\", \"{test03}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test04\", \"{test04}\").or(new True())))).and(RequestParameter.matches(\"test05\", \"{test05}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test06\", \"{test06}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True())))).and(RequestParameter.matches(\"test03\", \"{test03}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test03\", \"{test03}\").or(new True())))).and(RequestParameter.matches(\"test04\", \"{test04}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test03\", \"{test03}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True())))).and(RequestParameter.matches(\"test03\", \"{test03}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test04\", \"{test04}\").or(new True())))).and(RequestParameter.matches(\"test05\", \"{test05}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test03\", \"{test03}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True())))).and(RequestParameter.matches(\"test03\", \"{test03}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test04\", \"{test04}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True())))).and(RequestParameter.matches(\"test03\", \"{test03}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test03\", \"{test03}\").or(new True())))).and(RequestParameter.matches(\"test04\", \"{test04}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test05\", \"{test05}\").or(new True())))).and(RequestParameter.matches(\"test06\", \"{test06}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test07\", \"{test07}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True())))).and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))\r\n.and(RequestParameter.matches(\"test02\", \"{test02}\").or(new True())))).and(RequestParameter.matches(\"test03\", \"{test03}\").or(new True()))))\r\n.and(.and(.and(RequestParameter.matches(\"test01\", \"{test01}\").or(new True()))))...\r\n```\r\nThe output is not even complete (see ```...``` at the end).\r\n\r\nWith more than 10 ```@Parameter``` annotations used the response time on the affected JSF page reaches >5 seconds."},"comment":{"url":"https://api.github.com/repos/ocpsoft/rewrite/issues/comments/68987448","html_url":"https://github.com/ocpsoft/rewrite/issues/192#issuecomment-68987448","issue_url":"https://api.github.com/repos/ocpsoft/rewrite/issues/192","id":68987448,"user":{"login":"chkal","id":159245,"avatar_url":"https://avatars.githubusercontent.com/u/159245?v=3","gravatar_id":"","url":"https://api.github.com/users/chkal","html_url":"https://github.com/chkal","followers_url":"https://api.github.com/users/chkal/followers","following_url":"https://api.github.com/users/chkal/following{/other_user}","gists_url":"https://api.github.com/users/chkal/gists{/gist_id}","starred_url":"https://api.github.com/users/chkal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chkal/subscriptions","organizations_url":"https://api.github.com/users/chkal/orgs","repos_url":"https://api.github.com/users/chkal/repos","events_url":"https://api.github.com/users/chkal/events{/privacy}","received_events_url":"https://api.github.com/users/chkal/received_events","type":"User","site_admin":false},"created_at":"2015-01-07T07:26:26Z","updated_at":"2015-01-07T07:26:26Z","body":"I just fixed the snapshot deployment issues we had. So the latest snapshots are now available in the Sonatype OSS snapshots repository.\r\n\r\nSee this for details:\r\n\r\nhttps://github.com/ocpsoft/rewrite/wiki/Snapshots"}}