{"action":"created","issue":{"url":"https://api.github.com/repos/amaembo/streamex/issues/63","labels_url":"https://api.github.com/repos/amaembo/streamex/issues/63/labels{/name}","comments_url":"https://api.github.com/repos/amaembo/streamex/issues/63/comments","events_url":"https://api.github.com/repos/amaembo/streamex/issues/63/events","html_url":"https://github.com/amaembo/streamex/issues/63","id":129966237,"number":63,"title":"IntStreamEx/LongStreamEx.reverseSorted() optimization","user":{"login":"amaembo","id":5114450,"avatar_url":"https://avatars.githubusercontent.com/u/5114450?v=3","gravatar_id":"","url":"https://api.github.com/users/amaembo","html_url":"https://github.com/amaembo","followers_url":"https://api.github.com/users/amaembo/followers","following_url":"https://api.github.com/users/amaembo/following{/other_user}","gists_url":"https://api.github.com/users/amaembo/gists{/gist_id}","starred_url":"https://api.github.com/users/amaembo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amaembo/subscriptions","organizations_url":"https://api.github.com/users/amaembo/orgs","repos_url":"https://api.github.com/users/amaembo/repos","events_url":"https://api.github.com/users/amaembo/events{/privacy}","received_events_url":"https://api.github.com/users/amaembo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-30T09:38:57Z","updated_at":"2016-01-30T11:03:43Z","closed_at":null,"body":"Currently `IntStreamEx.reverseSorted()` implemented like `boxed().sorted(Comparator.reverseOrder()).mapToInt(Integer::intValue)`. More efficient implementation like `map(x -> -1-x).sorted().map(x -> -1-x)` is possible which has no boxing. Similarly `LongStreamEx.reverseSorted()` can be optimized. `DoubleStreamEx.reverseSorted()` is more problematic due to `NaN` values.\r\n\r\n* [ ] Implementation\r\n* [ ] Benchmark\r\n* [ ] Changes"},"comment":{"url":"https://api.github.com/repos/amaembo/streamex/issues/comments/177147876","html_url":"https://github.com/amaembo/streamex/issues/63#issuecomment-177147876","issue_url":"https://api.github.com/repos/amaembo/streamex/issues/63","id":177147876,"user":{"login":"amaembo","id":5114450,"avatar_url":"https://avatars.githubusercontent.com/u/5114450?v=3","gravatar_id":"","url":"https://api.github.com/users/amaembo","html_url":"https://github.com/amaembo","followers_url":"https://api.github.com/users/amaembo/followers","following_url":"https://api.github.com/users/amaembo/following{/other_user}","gists_url":"https://api.github.com/users/amaembo/gists{/gist_id}","starred_url":"https://api.github.com/users/amaembo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amaembo/subscriptions","organizations_url":"https://api.github.com/users/amaembo/orgs","repos_url":"https://api.github.com/users/amaembo/repos","events_url":"https://api.github.com/users/amaembo/events{/privacy}","received_events_url":"https://api.github.com/users/amaembo/received_events","type":"User","site_admin":false},"created_at":"2016-01-30T11:03:43Z","updated_at":"2016-01-30T11:03:43Z","body":"Benchmark clearly shows that the optimized version is much better:\r\n\r\nBenchmark | (n) | 0.5.4 | 0.5.5\r\n---|---:|---:|---:\r\nparInt | 10 | 5.146 | 3.687\r\nparInt | 1000 | 126.157 | 33.112\r\nparInt | 100000 | 7071.053 | 2875.504\r\nparLong | 10 | 5.635 | 4.351\r\nparLong | 1000 | 129.134 | 41.165\r\nparLong | 100000 | 7604.668 | 3136.565\r\nseqInt | 10 | 0.325 | 0.203\r\nseqInt | 1000 | 100.876 | 21.532\r\nseqInt | 100000 | 19097.340 | 7259.988\r\nseqLong | 10 | 0.369 | 0.230\r\nseqLong | 1000 | 107.777 | 26.102\r\nseqLong | 100000 | 20030.837 | 7357.134\r\n"}}