{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/yoga/issues/258","repository_url":"https://api.github.com/repos/facebook/yoga","labels_url":"https://api.github.com/repos/facebook/yoga/issues/258/labels{/name}","comments_url":"https://api.github.com/repos/facebook/yoga/issues/258/comments","events_url":"https://api.github.com/repos/facebook/yoga/issues/258/events","html_url":"https://github.com/facebook/yoga/pull/258","id":191154289,"number":258,"title":"Add feature to use percentage as value unit","user":{"login":"woehrl01","id":2535856,"avatar_url":"https://avatars.githubusercontent.com/u/2535856?v=3","gravatar_id":"","url":"https://api.github.com/users/woehrl01","html_url":"https://github.com/woehrl01","followers_url":"https://api.github.com/users/woehrl01/followers","following_url":"https://api.github.com/users/woehrl01/following{/other_user}","gists_url":"https://api.github.com/users/woehrl01/gists{/gist_id}","starred_url":"https://api.github.com/users/woehrl01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woehrl01/subscriptions","organizations_url":"https://api.github.com/users/woehrl01/orgs","repos_url":"https://api.github.com/users/woehrl01/repos","events_url":"https://api.github.com/users/woehrl01/events{/privacy}","received_events_url":"https://api.github.com/users/woehrl01/received_events","type":"User","site_admin":false},"labels":[{"id":196858700,"url":"https://api.github.com/repos/facebook/yoga/labels/CLA%20Signed","name":"CLA Signed","color":"009900","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":28,"created_at":"2016-11-22T23:35:42Z","updated_at":"2016-12-15T15:38:56Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/yoga/pulls/258","html_url":"https://github.com/facebook/yoga/pull/258","diff_url":"https://github.com/facebook/yoga/pull/258.diff","patch_url":"https://github.com/facebook/yoga/pull/258.patch"},"body":"Adds the feature to use percentage as a value unit.\r\n\r\nYou can use the Api as usual and you will use pixel. With the function ```Set*WithUnit``` you can provide the unit of the value (e.g. ```CSSNodeStyleSetWidthWithUnit```).\r\n\r\nYou can use the function ```Px(float)``` and ```Percent(float)``` for convenience. \r\n\r\nI did some benchmarks:\r\n\r\n```\r\nWithout Percentage Feature - Release x86:\r\n\r\nStack with flex: median: 0.000000 ms, stddev: 0.146683 ms\r\nAlign stretch in undefined axis: median: 0.000000 ms, stddev: 0.136525 ms\r\nNested flex: median: 0.000000 ms, stddev: 0.490101 ms\r\nHuge nested layout: median: 23.000000 ms, stddev: 0.928291 ms\r\n\r\nStack with flex: median: 0.000000 ms, stddev: 0.170587 ms\r\nAlign stretch in undefined axis: median: 0.000000 ms, stddev: 0.143384 ms\r\nNested flex: median: 0.000000 ms, stddev: 0.477791 ms\r\nHuge nested layout: median: 22.000000 ms, stddev: 2.129779 ms\r\n\r\n\r\nWith Percentage Feature - Release x86:\r\n\r\nStack with flex: median: 0.000000 ms, stddev: 0.153049 ms\r\nAlign stretch in undefined axis: median: 0.000000 ms, stddev: 0.149903 ms\r\nNested flex: median: 0.000000 ms, stddev: 0.493230 ms\r\nHuge nested layout: median: 25.000000 ms, stddev: 1.929974 ms\r\n\r\nStack with flex: median: 0.000000 ms, stddev: 0.153049 ms\r\nAlign stretch in undefined axis: median: 0.000000 ms, stddev: 0.143384 ms\r\nNested flex: median: 0.000000 ms, stddev: 0.490302 ms\r\nHuge nested layout: median: 25.000000 ms, stddev: 1.498933 ms\r\n```\r\n\r\nSo it definitely has an impact on the performance, not that much so imho. \r\n\r\nAll existing tests are currently passing.\r\n\r\nI opened this PR to make discussions on possible changes easier.\r\n\r\nI'm looking forward to your ideas.\r\n\r\nShould the ```Px()``` and ```Percent()``` functions  be prefixed with ```CSSLayout```?"},"comment":{"url":"https://api.github.com/repos/facebook/yoga/issues/comments/267358698","html_url":"https://github.com/facebook/yoga/pull/258#issuecomment-267358698","issue_url":"https://api.github.com/repos/facebook/yoga/issues/258","id":267358698,"user":{"login":"emilsjolander","id":1525924,"avatar_url":"https://avatars.githubusercontent.com/u/1525924?v=3","gravatar_id":"","url":"https://api.github.com/users/emilsjolander","html_url":"https://github.com/emilsjolander","followers_url":"https://api.github.com/users/emilsjolander/followers","following_url":"https://api.github.com/users/emilsjolander/following{/other_user}","gists_url":"https://api.github.com/users/emilsjolander/gists{/gist_id}","starred_url":"https://api.github.com/users/emilsjolander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emilsjolander/subscriptions","organizations_url":"https://api.github.com/users/emilsjolander/orgs","repos_url":"https://api.github.com/users/emilsjolander/repos","events_url":"https://api.github.com/users/emilsjolander/events{/privacy}","received_events_url":"https://api.github.com/users/emilsjolander/received_events","type":"User","site_admin":false},"created_at":"2016-12-15T15:38:56Z","updated_at":"2016-12-15T15:38:56Z","body":"Oh wow that is super confusing. "}}
{"actor":{"display_login":"emilsjolander"}}