{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/25293","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/25293/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/25293/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/25293/events","html_url":"https://github.com/rust-lang/rust/issues/25293","id":75039055,"number":25293,"title":"Benchmarks are run when just executing tests, leading to very slooooow tests","user":{"login":"shepmaster","id":174509,"avatar_url":"https://avatars.githubusercontent.com/u/174509?v=3","gravatar_id":"","url":"https://api.github.com/users/shepmaster","html_url":"https://github.com/shepmaster","followers_url":"https://api.github.com/users/shepmaster/followers","following_url":"https://api.github.com/users/shepmaster/following{/other_user}","gists_url":"https://api.github.com/users/shepmaster/gists{/gist_id}","starred_url":"https://api.github.com/users/shepmaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shepmaster/subscriptions","organizations_url":"https://api.github.com/users/shepmaster/orgs","repos_url":"https://api.github.com/users/shepmaster/repos","events_url":"https://api.github.com/users/shepmaster/events{/privacy}","received_events_url":"https://api.github.com/users/shepmaster/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-05-11T00:48:45Z","updated_at":"2015-05-11T10:41:12Z","closed_at":null,"body":"In my benchmarks, I generate some non-trivial sized blobs of data. Recently, my regular test runs have been very slow, and I believe it's because the benchmarks are running even when not passing `--bench`\r\n\r\n**bench.rs**\r\n\r\n```rust\r\n#![feature(test)]\r\n\r\nextern crate test;\r\nuse std::iter;\r\n\r\n#[bench]\r\nfn slow(b: &mut test::Bencher) {\r\n    // This is dog-slow without optimizations...\r\n    let s: String = iter::repeat(\"a\").take(5*1024*1024).collect();\r\n    println!(\"I made a string\");\r\n    b.iter(|| 1 + 1);\r\n    b.bytes = s.len() as u64;\r\n}\r\n```\r\n\r\nAnd running it:\r\n\r\n```\r\n$ rustc --test bench.rs\r\n$ ./bench --nocapture\r\n\r\nrunning 1 test\r\nI made a string\r\ntest slow ... ok\r\n\r\ntest result: ok. 1 passed; 0 failed; 0 ignored; 0 measured\r\n```\r\n\r\nEven running with `--test` still runs these very slow tests."},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/100863556","html_url":"https://github.com/rust-lang/rust/issues/25293#issuecomment-100863556","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/25293","id":100863556,"user":{"login":"bluss","id":3209739,"avatar_url":"https://avatars.githubusercontent.com/u/3209739?v=3","gravatar_id":"","url":"https://api.github.com/users/bluss","html_url":"https://github.com/bluss","followers_url":"https://api.github.com/users/bluss/followers","following_url":"https://api.github.com/users/bluss/following{/other_user}","gists_url":"https://api.github.com/users/bluss/gists{/gist_id}","starred_url":"https://api.github.com/users/bluss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluss/subscriptions","organizations_url":"https://api.github.com/users/bluss/orgs","repos_url":"https://api.github.com/users/bluss/repos","events_url":"https://api.github.com/users/bluss/events{/privacy}","received_events_url":"https://api.github.com/users/bluss/received_events","type":"User","site_admin":false},"created_at":"2015-05-11T10:41:12Z","updated_at":"2015-05-11T10:41:12Z","body":"Maybe move benchmarks into cargo's benches directory? I assume those won't run during cargo test."}}