{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/48371","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/48371/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/48371/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/48371/events","html_url":"https://github.com/rust-lang/rust/issues/48371","id":298613540,"number":48371,"title":"Slower performance caused only by using LTO","user":{"login":"pmarcelll","id":1909968,"avatar_url":"https://avatars1.githubusercontent.com/u/1909968?v=4","gravatar_id":"","url":"https://api.github.com/users/pmarcelll","html_url":"https://github.com/pmarcelll","followers_url":"https://api.github.com/users/pmarcelll/followers","following_url":"https://api.github.com/users/pmarcelll/following{/other_user}","gists_url":"https://api.github.com/users/pmarcelll/gists{/gist_id}","starred_url":"https://api.github.com/users/pmarcelll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmarcelll/subscriptions","organizations_url":"https://api.github.com/users/pmarcelll/orgs","repos_url":"https://api.github.com/users/pmarcelll/repos","events_url":"https://api.github.com/users/pmarcelll/events{/privacy}","received_events_url":"https://api.github.com/users/pmarcelll/received_events","type":"User","site_admin":false},"labels":[{"id":234902,"url":"https://api.github.com/repos/rust-lang/rust/labels/C-enhancement","name":"C-enhancement","color":"f5f1fd","default":false},{"id":113376,"url":"https://api.github.com/repos/rust-lang/rust/labels/I-slow","name":"I-slow","color":"e10c02","default":false},{"id":211668100,"url":"https://api.github.com/repos/rust-lang/rust/labels/T-compiler","name":"T-compiler","color":"bfd4f2","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2018-02-20T14:28:30Z","updated_at":"2018-02-24T18:05:29Z","closed_at":"2018-02-20T20:41:26Z","author_association":"CONTRIBUTOR","body":"[The Computer Language Benchmarks Game](https://benchmarksgame.alioth.debian.org/) was on the Rust subreddit recently and while I checked out the numbers for Rust, I noticed that the Rust solution for the [fasta benchmark](https://benchmarksgame.alioth.debian.org/u64q/fasta.html) is much slower than the C version, although they work fairly similarly, the multithreading in the C version is based on the Rust version. It turned out that the Rust benchmarks are compiled with LTO by default, and when I tested the code on my machine without LTO (both stable and nightly), it was almost as fast as the C version. I tried to find an existing issue, but most of them are about slow compilation, not slow runtime.\r\n\r\nThe interesting thing is that on the CPU monitor graph it's clearly visible that during the last part of the benchmark all CPU cores are only on 70% usage (so it's like a mutex is locked for too long). I also checked the binary size, it went down from 4.4 MB to 3.1 MB with LTO.\r\n\r\nEDIT: I also tested it with the Mutex from `parking_lot`, it's still slow with LTO, but without it's a tiny bit faster than the C version."},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/368247262","html_url":"https://github.com/rust-lang/rust/issues/48371#issuecomment-368247262","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/48371","id":368247262,"user":{"login":"robsmith11","id":22622548,"avatar_url":"https://avatars2.githubusercontent.com/u/22622548?v=4","gravatar_id":"","url":"https://api.github.com/users/robsmith11","html_url":"https://github.com/robsmith11","followers_url":"https://api.github.com/users/robsmith11/followers","following_url":"https://api.github.com/users/robsmith11/following{/other_user}","gists_url":"https://api.github.com/users/robsmith11/gists{/gist_id}","starred_url":"https://api.github.com/users/robsmith11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robsmith11/subscriptions","organizations_url":"https://api.github.com/users/robsmith11/orgs","repos_url":"https://api.github.com/users/robsmith11/repos","events_url":"https://api.github.com/users/robsmith11/events{/privacy}","received_events_url":"https://api.github.com/users/robsmith11/received_events","type":"User","site_admin":false},"created_at":"2018-02-24T18:05:29Z","updated_at":"2018-02-24T18:05:29Z","author_association":"NONE","body":"I agree that this bug should be reopened.  My performance regression is also only with traditional \"fat\" LTO.\r\n\r\nWhy are multiple code-gens be using by default anyway?  I thought they were only going to be used with thin LTO.."}}
{"actor":{"display_login":"robsmith11"}}