{"action":"created","issue":{"url":"https://api.github.com/repos/minetest/minetest/issues/4998","repository_url":"https://api.github.com/repos/minetest/minetest","labels_url":"https://api.github.com/repos/minetest/minetest/issues/4998/labels{/name}","comments_url":"https://api.github.com/repos/minetest/minetest/issues/4998/comments","events_url":"https://api.github.com/repos/minetest/minetest/issues/4998/events","html_url":"https://github.com/minetest/minetest/pull/4998","id":199132253,"number":4998,"title":"Get neighbor from same map block if possible in ABMHandler","user":{"login":"lhofhansl","id":446130,"avatar_url":"https://avatars.githubusercontent.com/u/446130?v=3","gravatar_id":"","url":"https://api.github.com/users/lhofhansl","html_url":"https://github.com/lhofhansl","followers_url":"https://api.github.com/users/lhofhansl/followers","following_url":"https://api.github.com/users/lhofhansl/following{/other_user}","gists_url":"https://api.github.com/users/lhofhansl/gists{/gist_id}","starred_url":"https://api.github.com/users/lhofhansl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lhofhansl/subscriptions","organizations_url":"https://api.github.com/users/lhofhansl/orgs","repos_url":"https://api.github.com/users/lhofhansl/repos","events_url":"https://api.github.com/users/lhofhansl/events{/privacy}","received_events_url":"https://api.github.com/users/lhofhansl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-01-06T06:19:31Z","updated_at":"2017-01-06T06:26:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/minetest/minetest/pulls/4998","html_url":"https://github.com/minetest/minetest/pull/4998","diff_url":"https://github.com/minetest/minetest/pull/4998.diff","patch_url":"https://github.com/minetest/minetest/pull/4998.patch"},"body":"I noticed that when I use the Technic mod and a larg'ish `active_block_range` - 7 or 8 in my case - I see messages like these:\r\n`2017-01-05 21:55:04: WARNING[Server]: active block modifiers took 623ms (longer than 200ms)`\r\n\r\nWithout actually doing anything. Turns out that the time is spent in the required neighbor check.\r\nLooking at the code one can observe that the majority of the neighbors of the nodes are actually found in the very map block that we already have a reference to; so use that one to get the neighorhing map node instead of going back to getting the mapnode via map->sector->mapblock->mapnode.\r\n\r\nThat brought the max down from 623ms to to 223ms. And the average from about 490ms to 210ms.\r\n"},"comment":{"url":"https://api.github.com/repos/minetest/minetest/issues/comments/270840947","html_url":"https://github.com/minetest/minetest/pull/4998#issuecomment-270840947","issue_url":"https://api.github.com/repos/minetest/minetest/issues/4998","id":270840947,"user":{"login":"lhofhansl","id":446130,"avatar_url":"https://avatars.githubusercontent.com/u/446130?v=3","gravatar_id":"","url":"https://api.github.com/users/lhofhansl","html_url":"https://github.com/lhofhansl","followers_url":"https://api.github.com/users/lhofhansl/followers","following_url":"https://api.github.com/users/lhofhansl/following{/other_user}","gists_url":"https://api.github.com/users/lhofhansl/gists{/gist_id}","starred_url":"https://api.github.com/users/lhofhansl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lhofhansl/subscriptions","organizations_url":"https://api.github.com/users/lhofhansl/orgs","repos_url":"https://api.github.com/users/lhofhansl/repos","events_url":"https://api.github.com/users/lhofhansl/events{/privacy}","received_events_url":"https://api.github.com/users/lhofhansl/received_events","type":"User","site_admin":false},"created_at":"2017-01-06T06:26:43Z","updated_at":"2017-01-06T06:26:43Z","body":"And note that in the worst case we're checking 16^3 * (3^3-1) = 106496 per _single_ map block, so this is well worth optimizing."}}
{"actor":{"display_login":"lhofhansl"}}