{"action":"created","comment":{"url":"https://api.github.com/repos/tsg-ut/mnemo/pulls/comments/93170175","pull_request_review_id":13691605,"id":93170175,"diff_hunk":"@@ -273,28 +293,36 @@ class Block extends EventEmitter {\n \t\tswitch (direction) {\n \t\t\tcase 'top':\n \t\t\t\tif (0 <= this.y - 1) {\n-\t\t\t\t\tthis.board.getBlock(this.x, this.y - 1).input('bottom', data);\n+\t\t\t\t\tconst nextBlock = this.board.getBlock(this.x, this.y - 1);\n+\t\t\t\t\tnextBlock.input('bottom', data);\n+\t\t\t\t\tnextBlock.passedExists = true;","path":"lib/block.js","position":361,"original_position":361,"commit_id":"d40c7540a61aad56262ac34d3787cbfba2dead02","original_commit_id":"d40c7540a61aad56262ac34d3787cbfba2dead02","user":{"login":"hakatashi","id":3126484,"avatar_url":"https://avatars.githubusercontent.com/u/3126484?v=3","gravatar_id":"","url":"https://api.github.com/users/hakatashi","html_url":"https://github.com/hakatashi","followers_url":"https://api.github.com/users/hakatashi/followers","following_url":"https://api.github.com/users/hakatashi/following{/other_user}","gists_url":"https://api.github.com/users/hakatashi/gists{/gist_id}","starred_url":"https://api.github.com/users/hakatashi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hakatashi/subscriptions","organizations_url":"https://api.github.com/users/hakatashi/orgs","repos_url":"https://api.github.com/users/hakatashi/repos","events_url":"https://api.github.com/users/hakatashi/events{/privacy}","received_events_url":"https://api.github.com/users/hakatashi/received_events","type":"User","site_admin":false},"body":"これ、Block#inputに移動できないかな?","created_at":"2016-12-20T04:31:11Z","updated_at":"2016-12-20T04:31:14Z","html_url":"https://github.com/tsg-ut/mnemo/pull/207#discussion_r93170175","pull_request_url":"https://api.github.com/repos/tsg-ut/mnemo/pulls/207","_links":{"self":{"href":"https://api.github.com/repos/tsg-ut/mnemo/pulls/comments/93170175"},"html":{"href":"https://github.com/tsg-ut/mnemo/pull/207#discussion_r93170175"},"pull_request":{"href":"https://api.github.com/repos/tsg-ut/mnemo/pulls/207"}}},"pull_request":{"url":"https://api.github.com/repos/tsg-ut/mnemo/pulls/207","id":98411765,"html_url":"https://github.com/tsg-ut/mnemo/pull/207","diff_url":"https://github.com/tsg-ut/mnemo/pull/207.diff","patch_url":"https://github.com/tsg-ut/mnemo/pull/207.patch","issue_url":"https://api.github.com/repos/tsg-ut/mnemo/issues/207","number":207,"state":"open","locked":false,"title":"Board#runを高速化","user":{"login":"cookie-s","id":1732074,"avatar_url":"https://avatars.githubusercontent.com/u/1732074?v=3","gravatar_id":"","url":"https://api.github.com/users/cookie-s","html_url":"https://github.com/cookie-s","followers_url":"https://api.github.com/users/cookie-s/followers","following_url":"https://api.github.com/users/cookie-s/following{/other_user}","gists_url":"https://api.github.com/users/cookie-s/gists{/gist_id}","starred_url":"https://api.github.com/users/cookie-s/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cookie-s/subscriptions","organizations_url":"https://api.github.com/users/cookie-s/orgs","repos_url":"https://api.github.com/users/cookie-s/repos","events_url":"https://api.github.com/users/cookie-s/events{/privacy}","received_events_url":"https://api.github.com/users/cookie-s/received_events","type":"User","site_admin":false},"body":"#150 について。1.6倍の速さになった。\r\n\r\n検証では、1000クロック回した。\r\n``` diff\r\ndiff --git a/test/unit/board.ls b/test/unit/board.ls\r\nindex 6ec954a..be28880 100644\r\n--- a/test/unit/board.ls\r\n+++ b/test/unit/board.ls\r\n@@ -14,7 +14,7 @@ describe 'Board' ->\r\n       outputX: 2\r\n       width: 5\r\n       height: 4\r\n-      clock-limit: 100\r\n+      clock-limit: 1000\r\n\r\n   It 'carries input data to output when plugged input and output by wires' ->\r\n     resolve, reject <~ new Promise _\r\n@@ -121,6 +121,8 @@ describe 'Board' ->\r\n       expect @board.clock .to.equal 3\r\n\r\n     It 'limits maximum execution clocks to stage\\'s clock limit' ->\r\n+      @timeout 10000\r\n+\r\n       @board.place-block x: 1, y: 0, type: \\wireL, rotate: 1\r\n       @board.place-block x: 2, y: 0, type: \\wireT, rotate: 3\r\n       @board.place-block x: 1, y: 1, type: \\wireL, rotate: 0\r\n@@ -129,7 +131,7 @@ describe 'Board' ->\r\n       @board.run 7\r\n\r\n       expect @board.output-value .to.be.null\r\n-      expect @board.clock .to.equal 100\r\n+      expect @board.clock .to.equal 1000\r\n\r\n     It 'limits simultaneous data count to 100' ->\r\n       for x from 0 to 4\r\n```\r\nとして、このテストを使って時間を計測した。\r\n\r\n直す前に動かしながらボトルネックを探すとかはあんまりやってない。\r\n実施した変更は3点。\r\n- Board#stepで、新たな出力があったかどうか調べていたのをBlock#stepにやらせる(4381ms->3913ms)\r\n- Board#step, passでget datasを使っていたのを、dataCountを使うようにする(->3334ms)\r\n- さらにdataCountでなくてdataExistsを定義して、使う。(->2733ms)\r\n\r\nBlock#step、どうせ何も返していなかったので、自分が何か出力したかどうかを変えさせて、Board#stepで調査していた分を省略した。\r\n\r\nget datas、配列をconcatしまくってて、重そうな上に、datasの使われ方がそのあとlengthをとるだけだったので、dataExistsとかいうdataがあったらtrueを返すだけのものを作った。\r\n\r\nget datas、使われなくなったので消した。\r\n\r\n1.6倍って微妙だよなぁ。","created_at":"2016-12-16T22:14:54Z","updated_at":"2016-12-20T04:31:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"55e9bb5582c47eb6155068cb088c118449c6abe3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/tsg-ut/mnemo/pulls/207/commits","review_comments_url":"https://api.github.com/repos/tsg-ut/mnemo/pulls/207/comments","review_comment_url":"https://api.github.com/repos/tsg-ut/mnemo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tsg-ut/mnemo/issues/207/comments","statuses_url":"https://api.github.com/repos/tsg-ut/mnemo/statuses/d40c7540a61aad56262ac34d3787cbfba2dead02","head":{"label":"tsg-ut:fast-run","ref":"fast-run","sha":"d40c7540a61aad56262ac34d3787cbfba2dead02","user":{"login":"tsg-ut","id":6879604,"avatar_url":"https://avatars.githubusercontent.com/u/6879604?v=3","gravatar_id":"","url":"https://api.github.com/users/tsg-ut","html_url":"https://github.com/tsg-ut","followers_url":"https://api.github.com/users/tsg-ut/followers","following_url":"https://api.github.com/users/tsg-ut/following{/other_user}","gists_url":"https://api.github.com/users/tsg-ut/gists{/gist_id}","starred_url":"https://api.github.com/users/tsg-ut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsg-ut/subscriptions","organizations_url":"https://api.github.com/users/tsg-ut/orgs","repos_url":"https://api.github.com/users/tsg-ut/repos","events_url":"https://api.github.com/users/tsg-ut/events{/privacy}","received_events_url":"https://api.github.com/users/tsg-ut/received_events","type":"Organization","site_admin":false},"repo":{"id":62435875,"name":"mnemo","full_name":"tsg-ut/mnemo","owner":{"login":"tsg-ut","id":6879604,"avatar_url":"https://avatars.githubusercontent.com/u/6879604?v=3","gravatar_id":"","url":"https://api.github.com/users/tsg-ut","html_url":"https://github.com/tsg-ut","followers_url":"https://api.github.com/users/tsg-ut/followers","following_url":"https://api.github.com/users/tsg-ut/following{/other_user}","gists_url":"https://api.github.com/users/tsg-ut/gists{/gist_id}","starred_url":"https://api.github.com/users/tsg-ut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsg-ut/subscriptions","organizations_url":"https://api.github.com/users/tsg-ut/orgs","repos_url":"https://api.github.com/users/tsg-ut/repos","events_url":"https://api.github.com/users/tsg-ut/events{/privacy}","received_events_url":"https://api.github.com/users/tsg-ut/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tsg-ut/mnemo","description":"mnemo is a visual programming game","fork":false,"url":"https://api.github.com/repos/tsg-ut/mnemo","forks_url":"https://api.github.com/repos/tsg-ut/mnemo/forks","keys_url":"https://api.github.com/repos/tsg-ut/mnemo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tsg-ut/mnemo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tsg-ut/mnemo/teams","hooks_url":"https://api.github.com/repos/tsg-ut/mnemo/hooks","issue_events_url":"https://api.github.com/repos/tsg-ut/mnemo/issues/events{/number}","events_url":"https://api.github.com/repos/tsg-ut/mnemo/events","assignees_url":"https://api.github.com/repos/tsg-ut/mnemo/assignees{/user}","branches_url":"https://api.github.com/repos/tsg-ut/mnemo/branches{/branch}","tags_url":"https://api.github.com/repos/tsg-ut/mnemo/tags","blobs_url":"https://api.github.com/repos/tsg-ut/mnemo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tsg-ut/mnemo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tsg-ut/mnemo/git/refs{/sha}","trees_url":"https://api.github.com/repos/tsg-ut/mnemo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tsg-ut/mnemo/statuses/{sha}","languages_url":"https://api.github.com/repos/tsg-ut/mnemo/languages","stargazers_url":"https://api.github.com/repos/tsg-ut/mnemo/stargazers","contributors_url":"https://api.github.com/repos/tsg-ut/mnemo/contributors","subscribers_url":"https://api.github.com/repos/tsg-ut/mnemo/subscribers","subscription_url":"https://api.github.com/repos/tsg-ut/mnemo/subscription","commits_url":"https://api.github.com/repos/tsg-ut/mnemo/commits{/sha}","git_commits_url":"https://api.github.com/repos/tsg-ut/mnemo/git/commits{/sha}","comments_url":"https://api.github.com/repos/tsg-ut/mnemo/comments{/number}","issue_comment_url":"https://api.github.com/repos/tsg-ut/mnemo/issues/comments{/number}","contents_url":"https://api.github.com/repos/tsg-ut/mnemo/contents/{+path}","compare_url":"https://api.github.com/repos/tsg-ut/mnemo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tsg-ut/mnemo/merges","archive_url":"https://api.github.com/repos/tsg-ut/mnemo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tsg-ut/mnemo/downloads","issues_url":"https://api.github.com/repos/tsg-ut/mnemo/issues{/number}","pulls_url":"https://api.github.com/repos/tsg-ut/mnemo/pulls{/number}","milestones_url":"https://api.github.com/repos/tsg-ut/mnemo/milestones{/number}","notifications_url":"https://api.github.com/repos/tsg-ut/mnemo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tsg-ut/mnemo/labels{/name}","releases_url":"https://api.github.com/repos/tsg-ut/mnemo/releases{/id}","deployments_url":"https://api.github.com/repos/tsg-ut/mnemo/deployments","created_at":"2016-07-02T05:41:06Z","updated_at":"2016-12-14T00:25:15Z","pushed_at":"2016-12-19T22:11:18Z","git_url":"git://github.com/tsg-ut/mnemo.git","ssh_url":"git@github.com:tsg-ut/mnemo.git","clone_url":"https://github.com/tsg-ut/mnemo.git","svn_url":"https://github.com/tsg-ut/mnemo","homepage":"https://mnemo.pro/","size":5327,"stargazers_count":10,"watchers_count":10,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":44,"forks":1,"open_issues":44,"watchers":10,"default_branch":"master"}},"base":{"label":"tsg-ut:master","ref":"master","sha":"0c9eed05041a396919e407b473ea03e20ef7208a","user":{"login":"tsg-ut","id":6879604,"avatar_url":"https://avatars.githubusercontent.com/u/6879604?v=3","gravatar_id":"","url":"https://api.github.com/users/tsg-ut","html_url":"https://github.com/tsg-ut","followers_url":"https://api.github.com/users/tsg-ut/followers","following_url":"https://api.github.com/users/tsg-ut/following{/other_user}","gists_url":"https://api.github.com/users/tsg-ut/gists{/gist_id}","starred_url":"https://api.github.com/users/tsg-ut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsg-ut/subscriptions","organizations_url":"https://api.github.com/users/tsg-ut/orgs","repos_url":"https://api.github.com/users/tsg-ut/repos","events_url":"https://api.github.com/users/tsg-ut/events{/privacy}","received_events_url":"https://api.github.com/users/tsg-ut/received_events","type":"Organization","site_admin":false},"repo":{"id":62435875,"name":"mnemo","full_name":"tsg-ut/mnemo","owner":{"login":"tsg-ut","id":6879604,"avatar_url":"https://avatars.githubusercontent.com/u/6879604?v=3","gravatar_id":"","url":"https://api.github.com/users/tsg-ut","html_url":"https://github.com/tsg-ut","followers_url":"https://api.github.com/users/tsg-ut/followers","following_url":"https://api.github.com/users/tsg-ut/following{/other_user}","gists_url":"https://api.github.com/users/tsg-ut/gists{/gist_id}","starred_url":"https://api.github.com/users/tsg-ut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsg-ut/subscriptions","organizations_url":"https://api.github.com/users/tsg-ut/orgs","repos_url":"https://api.github.com/users/tsg-ut/repos","events_url":"https://api.github.com/users/tsg-ut/events{/privacy}","received_events_url":"https://api.github.com/users/tsg-ut/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tsg-ut/mnemo","description":"mnemo is a visual programming game","fork":false,"url":"https://api.github.com/repos/tsg-ut/mnemo","forks_url":"https://api.github.com/repos/tsg-ut/mnemo/forks","keys_url":"https://api.github.com/repos/tsg-ut/mnemo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tsg-ut/mnemo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tsg-ut/mnemo/teams","hooks_url":"https://api.github.com/repos/tsg-ut/mnemo/hooks","issue_events_url":"https://api.github.com/repos/tsg-ut/mnemo/issues/events{/number}","events_url":"https://api.github.com/repos/tsg-ut/mnemo/events","assignees_url":"https://api.github.com/repos/tsg-ut/mnemo/assignees{/user}","branches_url":"https://api.github.com/repos/tsg-ut/mnemo/branches{/branch}","tags_url":"https://api.github.com/repos/tsg-ut/mnemo/tags","blobs_url":"https://api.github.com/repos/tsg-ut/mnemo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tsg-ut/mnemo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tsg-ut/mnemo/git/refs{/sha}","trees_url":"https://api.github.com/repos/tsg-ut/mnemo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tsg-ut/mnemo/statuses/{sha}","languages_url":"https://api.github.com/repos/tsg-ut/mnemo/languages","stargazers_url":"https://api.github.com/repos/tsg-ut/mnemo/stargazers","contributors_url":"https://api.github.com/repos/tsg-ut/mnemo/contributors","subscribers_url":"https://api.github.com/repos/tsg-ut/mnemo/subscribers","subscription_url":"https://api.github.com/repos/tsg-ut/mnemo/subscription","commits_url":"https://api.github.com/repos/tsg-ut/mnemo/commits{/sha}","git_commits_url":"https://api.github.com/repos/tsg-ut/mnemo/git/commits{/sha}","comments_url":"https://api.github.com/repos/tsg-ut/mnemo/comments{/number}","issue_comment_url":"https://api.github.com/repos/tsg-ut/mnemo/issues/comments{/number}","contents_url":"https://api.github.com/repos/tsg-ut/mnemo/contents/{+path}","compare_url":"https://api.github.com/repos/tsg-ut/mnemo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tsg-ut/mnemo/merges","archive_url":"https://api.github.com/repos/tsg-ut/mnemo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tsg-ut/mnemo/downloads","issues_url":"https://api.github.com/repos/tsg-ut/mnemo/issues{/number}","pulls_url":"https://api.github.com/repos/tsg-ut/mnemo/pulls{/number}","milestones_url":"https://api.github.com/repos/tsg-ut/mnemo/milestones{/number}","notifications_url":"https://api.github.com/repos/tsg-ut/mnemo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tsg-ut/mnemo/labels{/name}","releases_url":"https://api.github.com/repos/tsg-ut/mnemo/releases{/id}","deployments_url":"https://api.github.com/repos/tsg-ut/mnemo/deployments","created_at":"2016-07-02T05:41:06Z","updated_at":"2016-12-14T00:25:15Z","pushed_at":"2016-12-19T22:11:18Z","git_url":"git://github.com/tsg-ut/mnemo.git","ssh_url":"git@github.com:tsg-ut/mnemo.git","clone_url":"https://github.com/tsg-ut/mnemo.git","svn_url":"https://github.com/tsg-ut/mnemo","homepage":"https://mnemo.pro/","size":5327,"stargazers_count":10,"watchers_count":10,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":44,"forks":1,"open_issues":44,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tsg-ut/mnemo/pulls/207"},"html":{"href":"https://github.com/tsg-ut/mnemo/pull/207"},"issue":{"href":"https://api.github.com/repos/tsg-ut/mnemo/issues/207"},"comments":{"href":"https://api.github.com/repos/tsg-ut/mnemo/issues/207/comments"},"review_comments":{"href":"https://api.github.com/repos/tsg-ut/mnemo/pulls/207/comments"},"review_comment":{"href":"https://api.github.com/repos/tsg-ut/mnemo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tsg-ut/mnemo/pulls/207/commits"},"statuses":{"href":"https://api.github.com/repos/tsg-ut/mnemo/statuses/d40c7540a61aad56262ac34d3787cbfba2dead02"}}}}
{"actor":{"display_login":"hakatashi"}}