{"action":"created","comment":{"url":"https://api.github.com/repos/tgstation/tgstation/pulls/comments/150400029","pull_request_review_id":75949136,"id":150400029,"diff_hunk":"@@ -214,17 +214,21 @@\n /proc/get_hearers_in_view(R, atom/source)\r\n \t// Returns a list of hearers in view(R) from source (ignoring luminosity). Used in saycode.\r\n \tvar/turf/T = get_turf(source)\r\n-\tvar/list/hear = list()\r\n+\t. = list()\r\n \r\n \tif(!T)\r\n-\t\treturn hear\r\n-\r\n-\tvar/list/range = get_hear(R, T)\r\n-\tfor(var/atom/movable/A in range)\r\n-\t\thear |= recursive_hear_check(A)\r\n-\r\n-\treturn hear\r\n+\t\treturn\r\n \r\n+\tif (R == 0) // if the range is zero, we know exactly where to look for, we can skip view\r\n+\t\t. = recursive_hear_check(T)\r\n+\telse  // A variation of get_hear inlined here to take advantage of the compiler's fastpath for obj/mob in view\r\n+\t\tvar/lum = T.luminosity\r\n+\t\tT.luminosity = 6\r\n+\t\tfor(var/obj/O in view(R, T))\r\n+\t\t\t. += recursive_hear_check(O)\r\n+\t\tfor(var/mob/M in view(R, T))\r\n+\t\t\t. += recursive_hear_check(M)\r","path":"code/__HELPERS/game.dm","position":25,"original_position":25,"commit_id":"76b2ded027699820a4d7f10e5b622d4e5b168207","original_commit_id":"76b2ded027699820a4d7f10e5b622d4e5b168207","user":{"login":"MrStonedOne","id":7069733,"avatar_url":"https://avatars1.githubusercontent.com/u/7069733?v=4","gravatar_id":"","url":"https://api.github.com/users/MrStonedOne","html_url":"https://github.com/MrStonedOne","followers_url":"https://api.github.com/users/MrStonedOne/followers","following_url":"https://api.github.com/users/MrStonedOne/following{/other_user}","gists_url":"https://api.github.com/users/MrStonedOne/gists{/gist_id}","starred_url":"https://api.github.com/users/MrStonedOne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrStonedOne/subscriptions","organizations_url":"https://api.github.com/users/MrStonedOne/orgs","repos_url":"https://api.github.com/users/MrStonedOne/repos","events_url":"https://api.github.com/users/MrStonedOne/events{/privacy}","received_events_url":"https://api.github.com/users/MrStonedOne/received_events","type":"User","site_admin":false},"body":"recursive_hear_check takes a list, you could likely speed this up even more by saving this to a temp list and calling recursive_hear_check once.\r\n","created_at":"2017-11-12T04:39:49Z","updated_at":"2017-11-12T04:39:49Z","html_url":"https://github.com/tgstation/tgstation/pull/32650#discussion_r150400029","pull_request_url":"https://api.github.com/repos/tgstation/tgstation/pulls/32650","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/tgstation/tgstation/pulls/comments/150400029"},"html":{"href":"https://github.com/tgstation/tgstation/pull/32650#discussion_r150400029"},"pull_request":{"href":"https://api.github.com/repos/tgstation/tgstation/pulls/32650"}}},"pull_request":{"url":"https://api.github.com/repos/tgstation/tgstation/pulls/32650","id":152085753,"html_url":"https://github.com/tgstation/tgstation/pull/32650","diff_url":"https://github.com/tgstation/tgstation/pull/32650.diff","patch_url":"https://github.com/tgstation/tgstation/pull/32650.patch","issue_url":"https://api.github.com/repos/tgstation/tgstation/issues/32650","number":32650,"state":"open","locked":false,"title":"Speeds up saycode by almost doubling get_hearers_in_view() performance","user":{"login":"vuonojenmustaturska","id":20017308,"avatar_url":"https://avatars1.githubusercontent.com/u/20017308?v=4","gravatar_id":"","url":"https://api.github.com/users/vuonojenmustaturska","html_url":"https://github.com/vuonojenmustaturska","followers_url":"https://api.github.com/users/vuonojenmustaturska/followers","following_url":"https://api.github.com/users/vuonojenmustaturska/following{/other_user}","gists_url":"https://api.github.com/users/vuonojenmustaturska/gists{/gist_id}","starred_url":"https://api.github.com/users/vuonojenmustaturska/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vuonojenmustaturska/subscriptions","organizations_url":"https://api.github.com/users/vuonojenmustaturska/orgs","repos_url":"https://api.github.com/users/vuonojenmustaturska/repos","events_url":"https://api.github.com/users/vuonojenmustaturska/events{/privacy}","received_events_url":"https://api.github.com/users/vuonojenmustaturska/received_events","type":"User","site_admin":false},"body":"This is the proc that is ultimately responsible for tcomms being in top10 during highpop. These numbers come from throwing station-bounced radios (canhear range 6) around and spamming the headset radio a lot, the actual results might be better on a real highpop environment where there are lots of range 0 radios around.\r\n\r\n| Proc Name                                           | Self CPU | Total CPU | Real Time | Calls |\r\n|-----------------------------------------------------|----------|-----------|-----------|-------|\r\n| /proc/newget_hearers_in_view                                | 0.166 | 0.277  | 0.279     | 3489  |\r\n|/proc/oldget_hearers_in_view                 | 0.162    | 0.450     | 0.444     | 3623  |\r\n\r\nDue to insufficiently robust testing, this definitely requires a testmerge.\r\n\r\n[Changelogs]:\r\n\r\n:cl: Naksu\r\nfix: Sped up saycode to remove free lag from highpop\r\n/:cl:\r\n","created_at":"2017-11-12T02:43:52Z","updated_at":"2017-11-12T04:39:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8742f56cdc0fce2625bd428fcc8aa5a22f17f954","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/tgstation/tgstation/pulls/32650/commits","review_comments_url":"https://api.github.com/repos/tgstation/tgstation/pulls/32650/comments","review_comment_url":"https://api.github.com/repos/tgstation/tgstation/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tgstation/tgstation/issues/32650/comments","statuses_url":"https://api.github.com/repos/tgstation/tgstation/statuses/76b2ded027699820a4d7f10e5b622d4e5b168207","head":{"label":"vuonojenmustaturska:saycode","ref":"saycode","sha":"76b2ded027699820a4d7f10e5b622d4e5b168207","user":{"login":"vuonojenmustaturska","id":20017308,"avatar_url":"https://avatars1.githubusercontent.com/u/20017308?v=4","gravatar_id":"","url":"https://api.github.com/users/vuonojenmustaturska","html_url":"https://github.com/vuonojenmustaturska","followers_url":"https://api.github.com/users/vuonojenmustaturska/followers","following_url":"https://api.github.com/users/vuonojenmustaturska/following{/other_user}","gists_url":"https://api.github.com/users/vuonojenmustaturska/gists{/gist_id}","starred_url":"https://api.github.com/users/vuonojenmustaturska/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vuonojenmustaturska/subscriptions","organizations_url":"https://api.github.com/users/vuonojenmustaturska/orgs","repos_url":"https://api.github.com/users/vuonojenmustaturska/repos","events_url":"https://api.github.com/users/vuonojenmustaturska/events{/privacy}","received_events_url":"https://api.github.com/users/vuonojenmustaturska/received_events","type":"User","site_admin":false},"repo":{"id":101099340,"name":"tgstation","full_name":"vuonojenmustaturska/tgstation","owner":{"login":"vuonojenmustaturska","id":20017308,"avatar_url":"https://avatars1.githubusercontent.com/u/20017308?v=4","gravatar_id":"","url":"https://api.github.com/users/vuonojenmustaturska","html_url":"https://github.com/vuonojenmustaturska","followers_url":"https://api.github.com/users/vuonojenmustaturska/followers","following_url":"https://api.github.com/users/vuonojenmustaturska/following{/other_user}","gists_url":"https://api.github.com/users/vuonojenmustaturska/gists{/gist_id}","starred_url":"https://api.github.com/users/vuonojenmustaturska/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vuonojenmustaturska/subscriptions","organizations_url":"https://api.github.com/users/vuonojenmustaturska/orgs","repos_url":"https://api.github.com/users/vuonojenmustaturska/repos","events_url":"https://api.github.com/users/vuonojenmustaturska/events{/privacy}","received_events_url":"https://api.github.com/users/vuonojenmustaturska/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vuonojenmustaturska/tgstation","description":"the /tg/station branch of SS13","fork":true,"url":"https://api.github.com/repos/vuonojenmustaturska/tgstation","forks_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/forks","keys_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/teams","hooks_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/hooks","issue_events_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/issues/events{/number}","events_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/events","assignees_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/assignees{/user}","branches_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/branches{/branch}","tags_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/tags","blobs_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/git/refs{/sha}","trees_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/statuses/{sha}","languages_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/languages","stargazers_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/stargazers","contributors_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/contributors","subscribers_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/subscribers","subscription_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/subscription","commits_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/commits{/sha}","git_commits_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/git/commits{/sha}","comments_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/comments{/number}","issue_comment_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/issues/comments{/number}","contents_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/contents/{+path}","compare_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/merges","archive_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/downloads","issues_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/issues{/number}","pulls_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/pulls{/number}","milestones_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/milestones{/number}","notifications_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/labels{/name}","releases_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/releases{/id}","deployments_url":"https://api.github.com/repos/vuonojenmustaturska/tgstation/deployments","created_at":"2017-08-22T19:22:48Z","updated_at":"2017-08-22T19:23:02Z","pushed_at":"2017-11-12T02:37:12Z","git_url":"git://github.com/vuonojenmustaturska/tgstation.git","ssh_url":"git@github.com:vuonojenmustaturska/tgstation.git","clone_url":"https://github.com/vuonojenmustaturska/tgstation.git","svn_url":"https://github.com/vuonojenmustaturska/tgstation","homepage":"http://www.tgstation13.org/","size":996316,"stargazers_count":0,"watchers_count":0,"language":"DM","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"tgstation:master","ref":"master","sha":"3093d8689772bed3f5de9bcb58b332e714fa9764","user":{"login":"tgstation","id":1363778,"avatar_url":"https://avatars2.githubusercontent.com/u/1363778?v=4","gravatar_id":"","url":"https://api.github.com/users/tgstation","html_url":"https://github.com/tgstation","followers_url":"https://api.github.com/users/tgstation/followers","following_url":"https://api.github.com/users/tgstation/following{/other_user}","gists_url":"https://api.github.com/users/tgstation/gists{/gist_id}","starred_url":"https://api.github.com/users/tgstation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgstation/subscriptions","organizations_url":"https://api.github.com/users/tgstation/orgs","repos_url":"https://api.github.com/users/tgstation/repos","events_url":"https://api.github.com/users/tgstation/events{/privacy}","received_events_url":"https://api.github.com/users/tgstation/received_events","type":"Organization","site_admin":false},"repo":{"id":3234987,"name":"tgstation","full_name":"tgstation/tgstation","owner":{"login":"tgstation","id":1363778,"avatar_url":"https://avatars2.githubusercontent.com/u/1363778?v=4","gravatar_id":"","url":"https://api.github.com/users/tgstation","html_url":"https://github.com/tgstation","followers_url":"https://api.github.com/users/tgstation/followers","following_url":"https://api.github.com/users/tgstation/following{/other_user}","gists_url":"https://api.github.com/users/tgstation/gists{/gist_id}","starred_url":"https://api.github.com/users/tgstation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgstation/subscriptions","organizations_url":"https://api.github.com/users/tgstation/orgs","repos_url":"https://api.github.com/users/tgstation/repos","events_url":"https://api.github.com/users/tgstation/events{/privacy}","received_events_url":"https://api.github.com/users/tgstation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tgstation/tgstation","description":"the /tg/station branch of SS13","fork":false,"url":"https://api.github.com/repos/tgstation/tgstation","forks_url":"https://api.github.com/repos/tgstation/tgstation/forks","keys_url":"https://api.github.com/repos/tgstation/tgstation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tgstation/tgstation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tgstation/tgstation/teams","hooks_url":"https://api.github.com/repos/tgstation/tgstation/hooks","issue_events_url":"https://api.github.com/repos/tgstation/tgstation/issues/events{/number}","events_url":"https://api.github.com/repos/tgstation/tgstation/events","assignees_url":"https://api.github.com/repos/tgstation/tgstation/assignees{/user}","branches_url":"https://api.github.com/repos/tgstation/tgstation/branches{/branch}","tags_url":"https://api.github.com/repos/tgstation/tgstation/tags","blobs_url":"https://api.github.com/repos/tgstation/tgstation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tgstation/tgstation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tgstation/tgstation/git/refs{/sha}","trees_url":"https://api.github.com/repos/tgstation/tgstation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tgstation/tgstation/statuses/{sha}","languages_url":"https://api.github.com/repos/tgstation/tgstation/languages","stargazers_url":"https://api.github.com/repos/tgstation/tgstation/stargazers","contributors_url":"https://api.github.com/repos/tgstation/tgstation/contributors","subscribers_url":"https://api.github.com/repos/tgstation/tgstation/subscribers","subscription_url":"https://api.github.com/repos/tgstation/tgstation/subscription","commits_url":"https://api.github.com/repos/tgstation/tgstation/commits{/sha}","git_commits_url":"https://api.github.com/repos/tgstation/tgstation/git/commits{/sha}","comments_url":"https://api.github.com/repos/tgstation/tgstation/comments{/number}","issue_comment_url":"https://api.github.com/repos/tgstation/tgstation/issues/comments{/number}","contents_url":"https://api.github.com/repos/tgstation/tgstation/contents/{+path}","compare_url":"https://api.github.com/repos/tgstation/tgstation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tgstation/tgstation/merges","archive_url":"https://api.github.com/repos/tgstation/tgstation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tgstation/tgstation/downloads","issues_url":"https://api.github.com/repos/tgstation/tgstation/issues{/number}","pulls_url":"https://api.github.com/repos/tgstation/tgstation/pulls{/number}","milestones_url":"https://api.github.com/repos/tgstation/tgstation/milestones{/number}","notifications_url":"https://api.github.com/repos/tgstation/tgstation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tgstation/tgstation/labels{/name}","releases_url":"https://api.github.com/repos/tgstation/tgstation/releases{/id}","deployments_url":"https://api.github.com/repos/tgstation/tgstation/deployments","created_at":"2012-01-21T17:32:47Z","updated_at":"2017-11-09T22:42:16Z","pushed_at":"2017-11-12T04:36:41Z","git_url":"git://github.com/tgstation/tgstation.git","ssh_url":"git@github.com:tgstation/tgstation.git","clone_url":"https://github.com/tgstation/tgstation.git","svn_url":"https://github.com/tgstation/tgstation","homepage":"http://www.tgstation13.org/","size":992936,"stargazers_count":425,"watchers_count":425,"language":"DM","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1604,"mirror_url":null,"archived":false,"open_issues_count":953,"forks":1604,"open_issues":953,"watchers":425,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tgstation/tgstation/pulls/32650"},"html":{"href":"https://github.com/tgstation/tgstation/pull/32650"},"issue":{"href":"https://api.github.com/repos/tgstation/tgstation/issues/32650"},"comments":{"href":"https://api.github.com/repos/tgstation/tgstation/issues/32650/comments"},"review_comments":{"href":"https://api.github.com/repos/tgstation/tgstation/pulls/32650/comments"},"review_comment":{"href":"https://api.github.com/repos/tgstation/tgstation/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tgstation/tgstation/pulls/32650/commits"},"statuses":{"href":"https://api.github.com/repos/tgstation/tgstation/statuses/76b2ded027699820a4d7f10e5b622d4e5b168207"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"MrStonedOne"}}