{"action":"created","issue":{"url":"https://api.github.com/repos/openfl/openfl/issues/660","labels_url":"https://api.github.com/repos/openfl/openfl/issues/660/labels{/name}","comments_url":"https://api.github.com/repos/openfl/openfl/issues/660/comments","events_url":"https://api.github.com/repos/openfl/openfl/issues/660/events","html_url":"https://github.com/openfl/openfl/issues/660","id":75461737,"number":660,"title":"Next graphics: Std.int's in GraphicRenderer.hx::_PointInTriangle are very slow","user":{"login":"jcward","id":2192439,"avatar_url":"https://avatars.githubusercontent.com/u/2192439?v=3","gravatar_id":"","url":"https://api.github.com/users/jcward","html_url":"https://github.com/jcward","followers_url":"https://api.github.com/users/jcward/followers","following_url":"https://api.github.com/users/jcward/following{/other_user}","gists_url":"https://api.github.com/users/jcward/gists{/gist_id}","starred_url":"https://api.github.com/users/jcward/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcward/subscriptions","organizations_url":"https://api.github.com/users/jcward/orgs","repos_url":"https://api.github.com/users/jcward/repos","events_url":"https://api.github.com/users/jcward/events{/privacy}","received_events_url":"https://api.github.com/users/jcward/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2015-05-12T04:50:48Z","updated_at":"2015-05-13T04:23:24Z","closed_at":null,"body":"Profiling my [Shape testcase](https://github.com/jcward/hxtelemetry/blob/master/test/DisplayingABitmap/Source/Main.hx) -- which is designed to be bad coding practice, don't judge =D -- in HxScout shows that the `Std.int()` calls in [GraphicRenderer.hx::_PointInTriangle](https://github.com/openfl/openfl/blame/1389dc63f1e9553c29e82eded70cdb628e472927/openfl/_internal/renderer/opengl/utils/GraphicsRenderer.hx#L1723-L1728) are where most time is spent.\r\n\r\nSimply removing those increases my framerate from ~30 to ~60fps. Presumably the idea was that Integer math is faster? Maybe on mobile? @mrcdk - was that the idea? Am I missing something?\r\n\r\n**Std.int:**\r\n![screenshot from 2015-05-11 22 36 04](https://cloud.githubusercontent.com/assets/2192439/7580234/8136e1f4-f82e-11e4-9a5e-06c6ded72057.png)\r\n![screenshot from 2015-05-11 22 35 50](https://cloud.githubusercontent.com/assets/2192439/7580232/8135097e-f82e-11e4-8a3d-b3e602f33937.png)\r\n\r\n**Removed:**\r\n\r\n    var v0x = (cx-ax);\r\n    var v0y = (cy-ay);\r\n    var v1x = (bx-ax);\r\n    var v1y = (by-ay);\r\n    var v2x = (px-ax);\r\n    var v2y = (py-ay);\r\n\r\n![screenshot from 2015-05-11 22 36 48](https://cloud.githubusercontent.com/assets/2192439/7580233/8135c594-f82e-11e4-9669-f2f105529521.png)\r\n![screenshot from 2015-05-11 22 36 40](https://cloud.githubusercontent.com/assets/2192439/7580235/8137cf2e-f82e-11e4-9f94-b7c5599de253.png)\r\n\r\nOr perhaps the question is, why is `Std.int` slow?"},"comment":{"url":"https://api.github.com/repos/openfl/openfl/issues/comments/101509435","html_url":"https://github.com/openfl/openfl/issues/660#issuecomment-101509435","issue_url":"https://api.github.com/repos/openfl/openfl/issues/660","id":101509435,"user":{"login":"jcward","id":2192439,"avatar_url":"https://avatars.githubusercontent.com/u/2192439?v=3","gravatar_id":"","url":"https://api.github.com/users/jcward","html_url":"https://github.com/jcward","followers_url":"https://api.github.com/users/jcward/followers","following_url":"https://api.github.com/users/jcward/following{/other_user}","gists_url":"https://api.github.com/users/jcward/gists{/gist_id}","starred_url":"https://api.github.com/users/jcward/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcward/subscriptions","organizations_url":"https://api.github.com/users/jcward/orgs","repos_url":"https://api.github.com/users/jcward/repos","events_url":"https://api.github.com/users/jcward/events{/privacy}","received_events_url":"https://api.github.com/users/jcward/received_events","type":"User","site_admin":false},"created_at":"2015-05-13T04:23:24Z","updated_at":"2015-05-13T04:23:24Z","body":"Indeed, there was a commit that removed the Floats and added Int, so I was asking the author of that commit about it."}}