{"action":"created","issue":{"url":"https://api.github.com/repos/MinetestForFun/server-minetestforfun/issues/179","labels_url":"https://api.github.com/repos/MinetestForFun/server-minetestforfun/issues/179/labels{/name}","comments_url":"https://api.github.com/repos/MinetestForFun/server-minetestforfun/issues/179/comments","events_url":"https://api.github.com/repos/MinetestForFun/server-minetestforfun/issues/179/events","html_url":"https://github.com/MinetestForFun/server-minetestforfun/issues/179","id":97929624,"number":179,"title":"Convert globalstep + timer into minetest.after","user":{"login":"gravgun","id":396420,"avatar_url":"https://avatars.githubusercontent.com/u/396420?v=3","gravatar_id":"","url":"https://api.github.com/users/gravgun","html_url":"https://github.com/gravgun","followers_url":"https://api.github.com/users/gravgun/followers","following_url":"https://api.github.com/users/gravgun/following{/other_user}","gists_url":"https://api.github.com/users/gravgun/gists{/gist_id}","starred_url":"https://api.github.com/users/gravgun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gravgun/subscriptions","organizations_url":"https://api.github.com/users/gravgun/orgs","repos_url":"https://api.github.com/users/gravgun/repos","events_url":"https://api.github.com/users/gravgun/events{/privacy}","received_events_url":"https://api.github.com/users/gravgun/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/MinetestForFun/server-minetestforfun/labels/Modding","name":"Modding","color":"006b75"},{"url":"https://api.github.com/repos/MinetestForFun/server-minetestforfun/labels/Performance","name":"Performance","color":"fef2c0"},{"url":"https://api.github.com/repos/MinetestForFun/server-minetestforfun/labels/Priority:%20High","name":"Priority: High","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2015-07-29T12:59:40Z","updated_at":"2016-01-08T20:27:21Z","closed_at":null,"body":"Some mods implement their tick logic using globalstep callbacks and a timer variable. This is heavy because the Lua VM must execute every callback for each server step, however if there is a timer (generally 1s) most of the time no actual code gets executed, just the timer variable {in,de}cremented.\r\nReplacing this technique by [`minetest.after`](http://dev.minetest.net/minetest.after) would reduce code duplication as well as increase performance since all the timers this function creates are handled by the same loop (in [builtin/game/misc.lua#9](/minetest/minetest/blob/master/builtin/game/misc.lua#L9)), reducing the need to do context switches (locals) and allowing LuaJIT to streamline timer ticking to the maximum possible extent, thus increasing performance."},"comment":{"url":"https://api.github.com/repos/MinetestForFun/server-minetestforfun/issues/comments/170114423","html_url":"https://github.com/MinetestForFun/server-minetestforfun/issues/179#issuecomment-170114423","issue_url":"https://api.github.com/repos/MinetestForFun/server-minetestforfun/issues/179","id":170114423,"user":{"login":"neoascetic","id":725836,"avatar_url":"https://avatars.githubusercontent.com/u/725836?v=3","gravatar_id":"","url":"https://api.github.com/users/neoascetic","html_url":"https://github.com/neoascetic","followers_url":"https://api.github.com/users/neoascetic/followers","following_url":"https://api.github.com/users/neoascetic/following{/other_user}","gists_url":"https://api.github.com/users/neoascetic/gists{/gist_id}","starred_url":"https://api.github.com/users/neoascetic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neoascetic/subscriptions","organizations_url":"https://api.github.com/users/neoascetic/orgs","repos_url":"https://api.github.com/users/neoascetic/repos","events_url":"https://api.github.com/users/neoascetic/events{/privacy}","received_events_url":"https://api.github.com/users/neoascetic/received_events","type":"User","site_admin":false},"created_at":"2016-01-08T20:27:21Z","updated_at":"2016-01-08T20:27:21Z","body":"@gravgun This is sad. Do you know a better voxel game/engine with good modding facilities?"}}