GitHub PullRequestReviewCommentEvent at 2014-08-03 07:36:54
Repository: ashley
Actor: siondream
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/libgdx/ashley/pulls/comments/15733345","id":15733345,"diff_hunk":"@@ -0,0 +1,21 @@\n+package com.badlogic.ashley.core;\n+\n+public class ComponentMapper<T extends Component> {\n+\tprivate ComponentType componentType;","path":"ashley/src/com/badlogic/ashley/core/ComponentMapper.java","position":4,"original_position":4,"commit_id":"b69b0092688a217adbbec9ba32be4b17799a558d","original_commit_id":"b69b0092688a217adbbec9ba32be4b17799a558d","user":{"login":"siondream","id":570314,"avatar_url":"https://avatars.githubusercontent.com/u/570314?v=1","gravatar_id":"5e73fefa7e309ae1cf32ef494c56b756","url":"https://api.github.com/users/siondream","html_url":"https://github.com/siondream","followers_url":"https://api.github.com/users/siondream/followers","following_url":"https://api.github.com/users/siondream/following{/other_user}","gists_url":"https://api.github.com/users/siondream/gists{/gist_id}","starred_url":"https://api.github.com/users/siondream/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siondream/subscriptions","organizations_url":"https://api.github.com/users/siondream/orgs","repos_url":"https://api.github.com/users/siondream/repos","events_url":"https://api.github.com/users/siondream/events{/privacy}","received_events_url":"https://api.github.com/users/siondream/received_events","type":"User","site_admin":false},"body":"You're right.","created_at":"2014-08-03T07:36:54Z","updated_at":"2014-08-03T07:36:54Z","html_url":"https://github.com/libgdx/ashley/pull/38#discussion_r15733345","pull_request_url":"https://api.github.com/repos/libgdx/ashley/pulls/38","_links":{"self":{"href":"https://api.github.com/repos/libgdx/ashley/pulls/comments/15733345"},"html":{"href":"https://github.com/libgdx/ashley/pull/38#discussion_r15733345"},"pull_request":{"href":"https://api.github.com/repos/libgdx/ashley/pulls/38"}}},"pull_request":{"url":"https://api.github.com/repos/libgdx/ashley/pulls/38","id":19249434,"html_url":"https://github.com/libgdx/ashley/pull/38","diff_url":"https://github.com/libgdx/ashley/pull/38.diff","patch_url":"https://github.com/libgdx/ashley/pull/38.patch","issue_url":"https://api.github.com/repos/libgdx/ashley/issues/38","number":38,"state":"open","title":"Performance","user":{"login":"siondream","id":570314,"avatar_url":"https://avatars.githubusercontent.com/u/570314?v=1","gravatar_id":"5e73fefa7e309ae1cf32ef494c56b756","url":"https://api.github.com/users/siondream","html_url":"https://github.com/siondream","followers_url":"https://api.github.com/users/siondream/followers","following_url":"https://api.github.com/users/siondream/following{/other_user}","gists_url":"https://api.github.com/users/siondream/gists{/gist_id}","starred_url":"https://api.github.com/users/siondream/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siondream/subscriptions","organizations_url":"https://api.github.com/users/siondream/orgs","repos_url":"https://api.github.com/users/siondream/repos","events_url":"https://api.github.com/users/siondream/events{/privacy}","received_events_url":"https://api.github.com/users/siondream/received_events","type":"User","site_admin":false},"body":"A few changes mostly to improve performance but also to make the API simpler. This has been done after some benchmarking and profiling.\r\n\r\nI believe this makes the library a lot better but I wanted to check with other people before merging like crazy.\r\n\r\n`ComponentType` wasn't being used outside of `core` so it is now package protected.\r\n\r\n`Entity` carries a `Bag` of `Component` objects. `Components` are indexed using their `ComponentType` index for super fast retrieval. We no longer use a dictionary for this. Unfortunately, this breaks the API.\r\n\r\nIn order to retrieve a `Component` we use the `ComponentMapper` class. Similar to what Artemis does but with a lot less black magic. There are no annotations and it's easier to use.\r\n\r\n\tpublic class StateSystem extends IteratingSystem {\t\r\n\t\tprivate ComponentMapper<StateComponent> sm = ComponentMapper.getFor(StateComponent.class);\r\n\t\t\r\n\t\tpublic StateSystem() {\r\n\t\t\tsuper(Family.getFamilyFor(StateComponent.class));\r\n\t\t}\r\n\r\n\t\t@Override\r\n\t\tpublic void processEntity(Entity entity, float deltaTime) {\r\n\t\t\tsm.get(entity).time += deltaTime;\r\n\t\t}\r\n\t}\r\n\r\nRetrieving a component is now O(1) rather than O(logn)!","created_at":"2014-08-02T20:31:03Z","updated_at":"2014-08-03T07:36:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3575bb21869ad90e073c1a709da5f84fd5c65aa9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/libgdx/ashley/pulls/38/commits","review_comments_url":"https://api.github.com/repos/libgdx/ashley/pulls/38/comments","review_comment_url":"https://api.github.com/repos/libgdx/ashley/pulls/comments/{number}","comments_url":"https://api.github.com/repos/libgdx/ashley/issues/38/comments","statuses_url":"https://api.github.com/repos/libgdx/ashley/statuses/b69b0092688a217adbbec9ba32be4b17799a558d","head":{"label":"siondream:performance","ref":"performance","sha":"b69b0092688a217adbbec9ba32be4b17799a558d","user":{"login":"siondream","id":570314,"avatar_url":"https://avatars.githubusercontent.com/u/570314?v=1","gravatar_id":"5e73fefa7e309ae1cf32ef494c56b756","url":"https://api.github.com/users/siondream","html_url":"https://github.com/siondream","followers_url":"https://api.github.com/users/siondream/followers","following_url":"https://api.github.com/users/siondream/following{/other_user}","gists_url":"https://api.github.com/users/siondream/gists{/gist_id}","starred_url":"https://api.github.com/users/siondream/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siondream/subscriptions","organizations_url":"https://api.github.com/users/siondream/orgs","repos_url":"https://api.github.com/users/siondream/repos","events_url":"https://api.github.com/users/siondream/events{/privacy}","received_events_url":"https://api.github.com/users/siondream/received_events","type":"User","site_admin":false},"repo":{"id":22556669,"name":"ashley","full_name":"siondream/ashley","owner":{"login":"siondream","id":570314,"avatar_url":"https://avatars.githubusercontent.com/u/570314?v=1","gravatar_id":"5e73fefa7e309ae1cf32ef494c56b756","url":"https://api.github.com/users/siondream","html_url":"https://github.com/siondream","followers_url":"https://api.github.com/users/siondream/followers","following_url":"https://api.github.com/users/siondream/following{/other_user}","gists_url":"https://api.github.com/users/siondream/gists{/gist_id}","starred_url":"https://api.github.com/users/siondream/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siondream/subscriptions","organizations_url":"https://api.github.com/users/siondream/orgs","repos_url":"https://api.github.com/users/siondream/repos","events_url":"https://api.github.com/users/siondream/events{/privacy}","received_events_url":"https://api.github.com/users/siondream/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/siondream/ashley","description":"A Java entity system inspired by Ash & Artemis.","fork":true,"url":"https://api.github.com/repos/siondream/ashley","forks_url":"https://api.github.com/repos/siondream/ashley/forks","keys_url":"https://api.github.com/repos/siondream/ashley/keys{/key_id}","collaborators_url":"https://api.github.com/repos/siondream/ashley/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/siondream/ashley/teams","hooks_url":"https://api.github.com/repos/siondream/ashley/hooks","issue_events_url":"https://api.github.com/repos/siondream/ashley/issues/events{/number}","events_url":"https://api.github.com/repos/siondream/ashley/events","assignees_url":"https://api.github.com/repos/siondream/ashley/assignees{/user}","branches_url":"https://api.github.com/repos/siondream/ashley/branches{/branch}","tags_url":"https://api.github.com/repos/siondream/ashley/tags","blobs_url":"https://api.github.com/repos/siondream/ashley/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/siondream/ashley/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/siondream/ashley/git/refs{/sha}","trees_url":"https://api.github.com/repos/siondream/ashley/git/trees{/sha}","statuses_url":"https://api.github.com/repos/siondream/ashley/statuses/{sha}","languages_url":"https://api.github.com/repos/siondream/ashley/languages","stargazers_url":"https://api.github.com/repos/siondream/ashley/stargazers","contributors_url":"https://api.github.com/repos/siondream/ashley/contributors","subscribers_url":"https://api.github.com/repos/siondream/ashley/subscribers","subscription_url":"https://api.github.com/repos/siondream/ashley/subscription","commits_url":"https://api.github.com/repos/siondream/ashley/commits{/sha}","git_commits_url":"https://api.github.com/repos/siondream/ashley/git/commits{/sha}","comments_url":"https://api.github.com/repos/siondream/ashley/comments{/number}","issue_comment_url":"https://api.github.com/repos/siondream/ashley/issues/comments/{number}","contents_url":"https://api.github.com/repos/siondream/ashley/contents/{+path}","compare_url":"https://api.github.com/repos/siondream/ashley/compare/{base}...{head}","merges_url":"https://api.github.com/repos/siondream/ashley/merges","archive_url":"https://api.github.com/repos/siondream/ashley/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/siondream/ashley/downloads","issues_url":"https://api.github.com/repos/siondream/ashley/issues{/number}","pulls_url":"https://api.github.com/repos/siondream/ashley/pulls{/number}","milestones_url":"https://api.github.com/repos/siondream/ashley/milestones{/number}","notifications_url":"https://api.github.com/repos/siondream/ashley/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/siondream/ashley/labels{/name}","releases_url":"https://api.github.com/repos/siondream/ashley/releases{/id}","created_at":"2014-08-02T20:22:04Z","updated_at":"2014-08-02T17:08:41Z","pushed_at":"2014-08-02T20:25:11Z","git_url":"git://github.com/siondream/ashley.git","ssh_url":"git@github.com:siondream/ashley.git","clone_url":"https://github.com/siondream/ashley.git","svn_url":"https://github.com/siondream/ashley","homepage":"","size":9108,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"libgdx:master","ref":"master","sha":"e194e61d2dc4a33989b8ec60772ce46da49bfeb7","user":{"login":"libgdx","id":509841,"avatar_url":"https://avatars.githubusercontent.com/u/509841?v=1","gravatar_id":"8110497530ddd28188acbef66a11e0d3","url":"https://api.github.com/users/libgdx","html_url":"https://github.com/libgdx","followers_url":"https://api.github.com/users/libgdx/followers","following_url":"https://api.github.com/users/libgdx/following{/other_user}","gists_url":"https://api.github.com/users/libgdx/gists{/gist_id}","starred_url":"https://api.github.com/users/libgdx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libgdx/subscriptions","organizations_url":"https://api.github.com/users/libgdx/orgs","repos_url":"https://api.github.com/users/libgdx/repos","events_url":"https://api.github.com/users/libgdx/events{/privacy}","received_events_url":"https://api.github.com/users/libgdx/received_events","type":"Organization","site_admin":false},"repo":{"id":8206054,"name":"ashley","full_name":"libgdx/ashley","owner":{"login":"libgdx","id":509841,"avatar_url":"https://avatars.githubusercontent.com/u/509841?v=1","gravatar_id":"8110497530ddd28188acbef66a11e0d3","url":"https://api.github.com/users/libgdx","html_url":"https://github.com/libgdx","followers_url":"https://api.github.com/users/libgdx/followers","following_url":"https://api.github.com/users/libgdx/following{/other_user}","gists_url":"https://api.github.com/users/libgdx/gists{/gist_id}","starred_url":"https://api.github.com/users/libgdx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libgdx/subscriptions","organizations_url":"https://api.github.com/users/libgdx/orgs","repos_url":"https://api.github.com/users/libgdx/repos","events_url":"https://api.github.com/users/libgdx/events{/privacy}","received_events_url":"https://api.github.com/users/libgdx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/libgdx/ashley","description":"A Java entity system inspired by Ash & Artemis.","fork":false,"url":"https://api.github.com/repos/libgdx/ashley","forks_url":"https://api.github.com/repos/libgdx/ashley/forks","keys_url":"https://api.github.com/repos/libgdx/ashley/keys{/key_id}","collaborators_url":"https://api.github.com/repos/libgdx/ashley/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/libgdx/ashley/teams","hooks_url":"https://api.github.com/repos/libgdx/ashley/hooks","issue_events_url":"https://api.github.com/repos/libgdx/ashley/issues/events{/number}","events_url":"https://api.github.com/repos/libgdx/ashley/events","assignees_url":"https://api.github.com/repos/libgdx/ashley/assignees{/user}","branches_url":"https://api.github.com/repos/libgdx/ashley/branches{/branch}","tags_url":"https://api.github.com/repos/libgdx/ashley/tags","blobs_url":"https://api.github.com/repos/libgdx/ashley/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/libgdx/ashley/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/libgdx/ashley/git/refs{/sha}","trees_url":"https://api.github.com/repos/libgdx/ashley/git/trees{/sha}","statuses_url":"https://api.github.com/repos/libgdx/ashley/statuses/{sha}","languages_url":"https://api.github.com/repos/libgdx/ashley/languages","stargazers_url":"https://api.github.com/repos/libgdx/ashley/stargazers","contributors_url":"https://api.github.com/repos/libgdx/ashley/contributors","subscribers_url":"https://api.github.com/repos/libgdx/ashley/subscribers","subscription_url":"https://api.github.com/repos/libgdx/ashley/subscription","commits_url":"https://api.github.com/repos/libgdx/ashley/commits{/sha}","git_commits_url":"https://api.github.com/repos/libgdx/ashley/git/commits{/sha}","comments_url":"https://api.github.com/repos/libgdx/ashley/comments{/number}","issue_comment_url":"https://api.github.com/repos/libgdx/ashley/issues/comments/{number}","contents_url":"https://api.github.com/repos/libgdx/ashley/contents/{+path}","compare_url":"https://api.github.com/repos/libgdx/ashley/compare/{base}...{head}","merges_url":"https://api.github.com/repos/libgdx/ashley/merges","archive_url":"https://api.github.com/repos/libgdx/ashley/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/libgdx/ashley/downloads","issues_url":"https://api.github.com/repos/libgdx/ashley/issues{/number}","pulls_url":"https://api.github.com/repos/libgdx/ashley/pulls{/number}","milestones_url":"https://api.github.com/repos/libgdx/ashley/milestones{/number}","notifications_url":"https://api.github.com/repos/libgdx/ashley/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/libgdx/ashley/labels{/name}","releases_url":"https://api.github.com/repos/libgdx/ashley/releases{/id}","created_at":"2013-02-14T19:31:07Z","updated_at":"2014-08-03T07:03:54Z","pushed_at":"2014-07-29T19:49:29Z","git_url":"git://github.com/libgdx/ashley.git","ssh_url":"git@github.com:libgdx/ashley.git","clone_url":"https://github.com/libgdx/ashley.git","svn_url":"https://github.com/libgdx/ashley","homepage":"","size":9108,"stargazers_count":98,"watchers_count":98,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":27,"mirror_url":null,"open_issues_count":6,"forks":27,"open_issues":6,"watchers":98,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/libgdx/ashley/pulls/38"},"html":{"href":"https://github.com/libgdx/ashley/pull/38"},"issue":{"href":"https://api.github.com/repos/libgdx/ashley/issues/38"},"comments":{"href":"https://api.github.com/repos/libgdx/ashley/issues/38/comments"},"review_comments":{"href":"https://api.github.com/repos/libgdx/ashley/pulls/38/comments"},"review_comment":{"href":"https://api.github.com/repos/libgdx/ashley/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/libgdx/ashley/pulls/38/commits"},"statuses":{"href":"https://api.github.com/repos/libgdx/ashley/statuses/b69b0092688a217adbbec9ba32be4b17799a558d"}}}}