{"action":"created","issue":{"url":"https://api.github.com/repos/mesonbuild/meson/issues/3635","repository_url":"https://api.github.com/repos/mesonbuild/meson","labels_url":"https://api.github.com/repos/mesonbuild/meson/issues/3635/labels{/name}","comments_url":"https://api.github.com/repos/mesonbuild/meson/issues/3635/comments","events_url":"https://api.github.com/repos/mesonbuild/meson/issues/3635/events","html_url":"https://github.com/mesonbuild/meson/issues/3635","id":326721158,"node_id":"MDU6SXNzdWUzMjY3MjExNTg=","number":3635,"title":"Speed-up compiler checks by parallelizing where possible","user":{"login":"nirbheek","id":75801,"node_id":"MDQ6VXNlcjc1ODAx","avatar_url":"https://avatars0.githubusercontent.com/u/75801?v=4","gravatar_id":"","url":"https://api.github.com/users/nirbheek","html_url":"https://github.com/nirbheek","followers_url":"https://api.github.com/users/nirbheek/followers","following_url":"https://api.github.com/users/nirbheek/following{/other_user}","gists_url":"https://api.github.com/users/nirbheek/gists{/gist_id}","starred_url":"https://api.github.com/users/nirbheek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nirbheek/subscriptions","organizations_url":"https://api.github.com/users/nirbheek/orgs","repos_url":"https://api.github.com/users/nirbheek/repos","events_url":"https://api.github.com/users/nirbheek/events{/privacy}","received_events_url":"https://api.github.com/users/nirbheek/received_events","type":"User","site_admin":false},"labels":[{"id":251967616,"node_id":"MDU6TGFiZWwyNTE5Njc2MTY=","url":"https://api.github.com/repos/mesonbuild/meson/labels/compilers","name":"compilers","color":"c7def8","default":false},{"id":99546087,"node_id":"MDU6TGFiZWw5OTU0NjA4Nw==","url":"https://api.github.com/repos/mesonbuild/meson/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":448958539,"node_id":"MDU6TGFiZWw0NDg5NTg1Mzk=","url":"https://api.github.com/repos/mesonbuild/meson/labels/help%20wanted","name":"help wanted","color":"75B427","default":true},{"id":565616021,"node_id":"MDU6TGFiZWw1NjU2MTYwMjE=","url":"https://api.github.com/repos/mesonbuild/meson/labels/perf","name":"perf","color":"1d86db","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":50,"created_at":"2018-05-26T08:27:55Z","updated_at":"2018-11-12T20:11:47Z","closed_at":null,"author_association":"MEMBER","body":"Some compiler checks can be parallelized, for example:\r\n\r\n* `get_supported_arguments()`\r\n* `get_supported_link_arguments()`\r\n* `cross_compute_int()`: there are two branches at each guess, so we can run both at the same time, which will improve the worst-case time.\r\n\r\nWe should also add map-like API for batch-processing several `has_function()` and `has_header()` checks at once and sets values in a `configuration_data()` object, usually of the form:\r\n\r\n```meson\r\ncdata = configuration_data()\r\nif cc.has_function(func_name, prefix: includes)\r\n   cdata.set(func_name.to_upper().underscorify())\r\nendif\r\n```\r\n\r\nUsually this requires lambda support (or similar) to be able to do this, but since the function in this case is almost always the same, we can hard-code it in Meson. It would be a good default in case we want to extend it later anyway."},"comment":{"url":"https://api.github.com/repos/mesonbuild/meson/issues/comments/438013156","html_url":"https://github.com/mesonbuild/meson/issues/3635#issuecomment-438013156","issue_url":"https://api.github.com/repos/mesonbuild/meson/issues/3635","id":438013156,"node_id":"MDEyOklzc3VlQ29tbWVudDQzODAxMzE1Ng==","user":{"login":"jekstrand","id":3218227,"node_id":"MDQ6VXNlcjMyMTgyMjc=","avatar_url":"https://avatars3.githubusercontent.com/u/3218227?v=4","gravatar_id":"","url":"https://api.github.com/users/jekstrand","html_url":"https://github.com/jekstrand","followers_url":"https://api.github.com/users/jekstrand/followers","following_url":"https://api.github.com/users/jekstrand/following{/other_user}","gists_url":"https://api.github.com/users/jekstrand/gists{/gist_id}","starred_url":"https://api.github.com/users/jekstrand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jekstrand/subscriptions","organizations_url":"https://api.github.com/users/jekstrand/orgs","repos_url":"https://api.github.com/users/jekstrand/repos","events_url":"https://api.github.com/users/jekstrand/events{/privacy}","received_events_url":"https://api.github.com/users/jekstrand/received_events","type":"User","site_admin":false},"created_at":"2018-11-12T20:11:47Z","updated_at":"2018-11-12T20:11:47Z","author_association":"NONE","body":"Right, I wasn't really considering trying to accelerate `if` statements with a non-trivial `else`.  You would either have to speculatively execute both or have an IR and do transformations.  Since you don't want to add an IR (I don't blame you), we can throw that one out.  In the example you gave above, any speculative execution scheme is likely going to have a stall the moment they use `out` unless the interpreter goes to extreme heroics with conditional values.  That said, how common is that case?  I genuinely don't know.  Most of the examples that have been given and most of what I've seen in mesa only have the if.\r\n\r\nOn the one hand, there's the pragmatic \"accelerate what we can\" which says that if 95% of if statements are one-level with no else then we've accelerated 95% of if statements.  On the other hand, no one likes a performance cliff and someone is going to get grumpy if changing they way they write their meson a small amount makes giant differences in whether or not it can be parallelized."}}
{"actor":{"display_login":"jekstrand"}}