{"action":"closed","issue":{"url":"https://api.github.com/repos/andreaferretti/kmeans/issues/35","repository_url":"https://api.github.com/repos/andreaferretti/kmeans","labels_url":"https://api.github.com/repos/andreaferretti/kmeans/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/andreaferretti/kmeans/issues/35/comments","events_url":"https://api.github.com/repos/andreaferretti/kmeans/issues/35/events","html_url":"https://github.com/andreaferretti/kmeans/issues/35","id":103908540,"number":35,"title":"The java version is obviously cheating","user":{"login":"arloan","id":1157026,"avatar_url":"https://avatars.githubusercontent.com/u/1157026?v=3","gravatar_id":"","url":"https://api.github.com/users/arloan","html_url":"https://github.com/arloan","followers_url":"https://api.github.com/users/arloan/followers","following_url":"https://api.github.com/users/arloan/following{/other_user}","gists_url":"https://api.github.com/users/arloan/gists{/gist_id}","starred_url":"https://api.github.com/users/arloan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arloan/subscriptions","organizations_url":"https://api.github.com/users/arloan/orgs","repos_url":"https://api.github.com/users/arloan/repos","events_url":"https://api.github.com/users/arloan/events{/privacy}","received_events_url":"https://api.github.com/users/arloan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-30T08:53:12Z","updated_at":"2016-02-08T09:22:19Z","closed_at":"2016-02-08T09:22:19Z","body":"The java version of this k-means benchmark code is obviously cheating compared to other object-oriented language versions, i.e the ruby one. Since I'm not a language expert, I did not check other language versions other than java and ruby.\r\n\r\n- The java version reused the Centroids array between iterations for every run loop, while the ruby version re-allocates.\r\n\r\n- The java version uses `addToThis()` method to avoid allocating new Point object, while the ruby version allocates new Point object on every `+` operator calling. This makes the ruby version allocating Point object about 100,000 × 15 more times than the ruby version for every run. The `divideToThis()` does the same thing, but is fare less important then the former.\r\n"}}