{"action":"created","issue":{"url":"https://api.github.com/repos/armory3d/iron/issues/36","repository_url":"https://api.github.com/repos/armory3d/iron","labels_url":"https://api.github.com/repos/armory3d/iron/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/armory3d/iron/issues/36/comments","events_url":"https://api.github.com/repos/armory3d/iron/issues/36/events","html_url":"https://github.com/armory3d/iron/issues/36","id":314807504,"node_id":"MDU6SXNzdWUzMTQ4MDc1MDQ=","number":36,"title":"Use kha.math","user":{"login":"sh-dave","id":13007175,"node_id":"MDQ6VXNlcjEzMDA3MTc1","avatar_url":"https://avatars3.githubusercontent.com/u/13007175?v=4","gravatar_id":"","url":"https://api.github.com/users/sh-dave","html_url":"https://github.com/sh-dave","followers_url":"https://api.github.com/users/sh-dave/followers","following_url":"https://api.github.com/users/sh-dave/following{/other_user}","gists_url":"https://api.github.com/users/sh-dave/gists{/gist_id}","starred_url":"https://api.github.com/users/sh-dave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sh-dave/subscriptions","organizations_url":"https://api.github.com/users/sh-dave/orgs","repos_url":"https://api.github.com/users/sh-dave/repos","events_url":"https://api.github.com/users/sh-dave/events{/privacy}","received_events_url":"https://api.github.com/users/sh-dave/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2018-04-16T20:33:11Z","updated_at":"2018-12-04T21:57:54Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Most functions end with a `return this` to support call chaining, but not all. Was this by design or just a *didn't need it at that time* choice?\r\n"},"comment":{"url":"https://api.github.com/repos/armory3d/iron/issues/comments/444274549","html_url":"https://github.com/armory3d/iron/issues/36#issuecomment-444274549","issue_url":"https://api.github.com/repos/armory3d/iron/issues/36","id":444274549,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NDI3NDU0OQ==","user":{"login":"sh-dave","id":13007175,"node_id":"MDQ6VXNlcjEzMDA3MTc1","avatar_url":"https://avatars3.githubusercontent.com/u/13007175?v=4","gravatar_id":"","url":"https://api.github.com/users/sh-dave","html_url":"https://github.com/sh-dave","followers_url":"https://api.github.com/users/sh-dave/followers","following_url":"https://api.github.com/users/sh-dave/following{/other_user}","gists_url":"https://api.github.com/users/sh-dave/gists{/gist_id}","starred_url":"https://api.github.com/users/sh-dave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sh-dave/subscriptions","organizations_url":"https://api.github.com/users/sh-dave/orgs","repos_url":"https://api.github.com/users/sh-dave/repos","events_url":"https://api.github.com/users/sh-dave/events{/privacy}","received_events_url":"https://api.github.com/users/sh-dave/received_events","type":"User","site_admin":false},"created_at":"2018-12-04T21:57:54Z","updated_at":"2018-12-04T21:57:54Z","author_association":"CONTRIBUTOR","body":"That's not what i'm seeing in chrome:\r\n\r\nImmutable last line `var this2 = { x : v2_x / b3, y : v2_y / b3, z : v2_z / b3, w : 1.0};`\r\n\r\n```shell\r\n----START BENCHMARK: Mutable VS Immutable-----\r\n(index):40 Test mutable operations\r\n(index):61 That took: 2758\r\n(index):70 Test immutable operations\r\n(index):96 That took: 2104\r\n(index):97 mutable/immutable ratio: 1.3108365019011408\r\n```\r\n\r\nManually changed the last lines to something that is closer to what should be generated:\r\n\r\n```js\r\n//   var this2 = { x : v2_x / b3, y : v2_y / b3, z : v2_z / b3, w : 1.0};\r\n      var this2_x = v2_x / b3;\r\n      var this2_y = v2_y / b3;\r\n      var this2_z = v2_z / b3;\r\n      var this2_w =1.0;\r\n```\r\n```shell\r\n(index):30 ----START BENCHMARK: Mutable VS Immutable-----\r\n(index):40 Test mutable operations\r\n(index):61 That took: 2796\r\n(index):70 Test immutable operations\r\n(index):96 That took: 2044\r\n(index):97 mutable/immutable ratio: 1.3679060665362035\r\n```\r\n\r\nFirefox seems to have completely optimized away the immutable version 😅 \r\n\r\n```shell\r\n----START BENCHMARK: Mutable VS Immutable----- _display:30:1\r\nTest mutable operations _display:40:3\r\nThat took: 5698 _display:61:3\r\nTest immutable operations _display:70:3\r\nThat took: 82 _display:96:3\r\nmutable/immutable ratio: 69.48780487804878\r\n```\r\n\r\nI think you should update the benchmark to calculate a value that is printed after the tests, so it won't be optimized away."}}
{"actor":{"display_login":"sh-dave"}}