{"action":"created","issue":{"url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/1195","repository_url":"https://api.github.com/repos/joel-costigliola/assertj-core","labels_url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/1195/labels{/name}","comments_url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/1195/comments","events_url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/1195/events","html_url":"https://github.com/joel-costigliola/assertj-core/issues/1195","id":300891902,"number":1195,"title":"3.9.1 has bad performance regression","user":{"login":"testn","id":445123,"avatar_url":"https://avatars2.githubusercontent.com/u/445123?v=4","gravatar_id":"","url":"https://api.github.com/users/testn","html_url":"https://github.com/testn","followers_url":"https://api.github.com/users/testn/followers","following_url":"https://api.github.com/users/testn/following{/other_user}","gists_url":"https://api.github.com/users/testn/gists{/gist_id}","starred_url":"https://api.github.com/users/testn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/testn/subscriptions","organizations_url":"https://api.github.com/users/testn/orgs","repos_url":"https://api.github.com/users/testn/repos","events_url":"https://api.github.com/users/testn/events{/privacy}","received_events_url":"https://api.github.com/users/testn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"PascalSchumacher","id":2707245,"avatar_url":"https://avatars1.githubusercontent.com/u/2707245?v=4","gravatar_id":"","url":"https://api.github.com/users/PascalSchumacher","html_url":"https://github.com/PascalSchumacher","followers_url":"https://api.github.com/users/PascalSchumacher/followers","following_url":"https://api.github.com/users/PascalSchumacher/following{/other_user}","gists_url":"https://api.github.com/users/PascalSchumacher/gists{/gist_id}","starred_url":"https://api.github.com/users/PascalSchumacher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PascalSchumacher/subscriptions","organizations_url":"https://api.github.com/users/PascalSchumacher/orgs","repos_url":"https://api.github.com/users/PascalSchumacher/repos","events_url":"https://api.github.com/users/PascalSchumacher/events{/privacy}","received_events_url":"https://api.github.com/users/PascalSchumacher/received_events","type":"User","site_admin":false},"assignees":[{"login":"PascalSchumacher","id":2707245,"avatar_url":"https://avatars1.githubusercontent.com/u/2707245?v=4","gravatar_id":"","url":"https://api.github.com/users/PascalSchumacher","html_url":"https://github.com/PascalSchumacher","followers_url":"https://api.github.com/users/PascalSchumacher/followers","following_url":"https://api.github.com/users/PascalSchumacher/following{/other_user}","gists_url":"https://api.github.com/users/PascalSchumacher/gists{/gist_id}","starred_url":"https://api.github.com/users/PascalSchumacher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PascalSchumacher/subscriptions","organizations_url":"https://api.github.com/users/PascalSchumacher/orgs","repos_url":"https://api.github.com/users/PascalSchumacher/repos","events_url":"https://api.github.com/users/PascalSchumacher/events{/privacy}","received_events_url":"https://api.github.com/users/PascalSchumacher/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/joel-costigliola/assertj-core/milestones/37","html_url":"https://github.com/joel-costigliola/assertj-core/milestone/37","labels_url":"https://api.github.com/repos/joel-costigliola/assertj-core/milestones/37/labels","id":2948622,"number":37,"title":"3.10","description":null,"creator":{"login":"joel-costigliola","id":382613,"avatar_url":"https://avatars2.githubusercontent.com/u/382613?v=4","gravatar_id":"","url":"https://api.github.com/users/joel-costigliola","html_url":"https://github.com/joel-costigliola","followers_url":"https://api.github.com/users/joel-costigliola/followers","following_url":"https://api.github.com/users/joel-costigliola/following{/other_user}","gists_url":"https://api.github.com/users/joel-costigliola/gists{/gist_id}","starred_url":"https://api.github.com/users/joel-costigliola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joel-costigliola/subscriptions","organizations_url":"https://api.github.com/users/joel-costigliola/orgs","repos_url":"https://api.github.com/users/joel-costigliola/repos","events_url":"https://api.github.com/users/joel-costigliola/events{/privacy}","received_events_url":"https://api.github.com/users/joel-costigliola/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":6,"state":"open","created_at":"2017-11-30T09:37:27Z","updated_at":"2018-03-26T21:03:10Z","due_on":null,"closed_at":null},"comments":23,"created_at":"2018-02-28T04:58:49Z","updated_at":"2018-03-26T21:13:54Z","closed_at":null,"author_association":"NONE","body":"#### Summary\r\nAfter upgrading to 3.9.1, I notice a regression in term of performance. By digging down, I notice that it spends a lot of time in the following code\r\n\r\n```\r\n  public static TypeComparators defaultTypeComparators() {\r\n    TypeComparators comparatorByType = new TypeComparators();\r\n    comparatorByType.put(Double.class, new DoubleComparator(DOUBLE_COMPARATOR_PRECISION));\r\n    comparatorByType.put(Float.class, new FloatComparator(FLOAT_COMPARATOR_PRECISION));\r\n    return comparatorByType;\r\n  }\r\n```\r\n\r\nIt sounds like it performs too much memory allocation and reflection cost on the following stack trace. \r\n\r\n```\r\njava.lang.Class.getEnclosingMethod0() Class.java (native)\r\njava.lang.Class.getEnclosingMethodInfo() Class.java:1072\r\njava.lang.Class.getEnclosingClass() Class.java:1272\r\njava.lang.Class.getSimpleBinaryName() Class.java:1443\r\njava.lang.Class.getSimpleName() Class.java:1309\r\norg.assertj.core.internal.TypeComparators$$Lambda$77.apply(Object)\r\njava.util.Comparator.lambda$comparing$77a9974f$1(Function, Object, Object) Comparator.java:469\r\njava.util.Comparator$$Lambda$78.compare(Object, Object)\r\njava.util.TreeMap.compare(Object, Object) TreeMap.java:1295\r\njava.util.TreeMap.put(Object, Object) TreeMap.java:538\r\norg.assertj.core.internal.TypeComparators.put(Class, Comparator) TypeComparators.java:99\r\norg.assertj.core.internal.TypeComparators.defaultTypeComparators() TypeComparators.java:48\r\norg.assertj.core.api.AbstractIterableAssert.<init>(Iterable, Class) AbstractIterableAssert.java:112\r\norg.assertj.core.api.FactoryBasedNavigableIterableAssert.<init>(Iterable, Class, AssertFactory) FactoryBasedNavigableIterableAssert.java:32\r\norg.assertj.core.api.IterableAssert.<init>(Iterable) IterableAssert.java:49\r\norg.assertj.core.api.Assertions.assertThat(Iterable) Assertions.java:2586\r\n```\r\n\r\nThis additional overhead is caused by the change from HashMap to TreeMap and the use of ```Comparator.comparing(Class::getSimpleName)```\r\n\r\nassertj 3.8.0 does not have this problem."},"comment":{"url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/comments/376313768","html_url":"https://github.com/joel-costigliola/assertj-core/issues/1195#issuecomment-376313768","issue_url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/1195","id":376313768,"user":{"login":"joel-costigliola","id":382613,"avatar_url":"https://avatars2.githubusercontent.com/u/382613?v=4","gravatar_id":"","url":"https://api.github.com/users/joel-costigliola","html_url":"https://github.com/joel-costigliola","followers_url":"https://api.github.com/users/joel-costigliola/followers","following_url":"https://api.github.com/users/joel-costigliola/following{/other_user}","gists_url":"https://api.github.com/users/joel-costigliola/gists{/gist_id}","starred_url":"https://api.github.com/users/joel-costigliola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joel-costigliola/subscriptions","organizations_url":"https://api.github.com/users/joel-costigliola/orgs","repos_url":"https://api.github.com/users/joel-costigliola/repos","events_url":"https://api.github.com/users/joel-costigliola/events{/privacy}","received_events_url":"https://api.github.com/users/joel-costigliola/received_events","type":"User","site_admin":false},"created_at":"2018-03-26T21:13:54Z","updated_at":"2018-03-26T21:13:54Z","author_association":"OWNER","body":"I wonder guys if you are using soft assertions or not, we have replaced cglib by byte buddy, this might had an effect on performance (I will measure that soonish)."}}
{"actor":{"display_login":"joel-costigliola"}}