| 1 | #![feature(test)] |
| 2 | |
| 3 | extern crate testrust-analyzer cargo fomat-macros 0.3.2 test/; |
| 4 | |
| 5 | #[macro_use] extern crate fomat_macrosrust-analyzer cargo fomat-macros 0.3.2 fomat_macros/; |
| 6 | |
| 7 | use testrust-analyzer cargo test https://github.com/rust-lang/rust/library/test crate/::{Bencherrust-analyzer cargo test https://github.com/rust-lang/rust/library/test bench/Bencher#, black_boxrust-analyzer cargo test https://github.com/rust-lang/rust/library/test bench/black_box().}; |
| 8 | |
| 9 | #[benchrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/bench:] |
| 10 | fn literal_fomatrust-analyzer cargo fomat-macros 0.3.2 literal_fomat().(b: &mut Bencherrust-analyzer cargo test https://github.com/rust-lang/rust/library/test bench/Bencher#) { |
| 11 | b.iterrust-analyzer cargo test https://github.com/rust-lang/rust/library/test bench/impl#[Bencher]iter().(|| fomatrust-analyzer cargo fomat-macros 0.3.2 fomat!!("Hello")) |
| 12 | } |
| 13 | |
| 14 | #[benchrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/bench:] |
| 15 | fn literal_formatrust-analyzer cargo fomat-macros 0.3.2 literal_format().(b: &mut Bencherrust-analyzer cargo test https://github.com/rust-lang/rust/library/test bench/Bencher#) { |
| 16 | b.iterrust-analyzer cargo test https://github.com/rust-lang/rust/library/test bench/impl#[Bencher]iter().(|| formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("Hello")) |
| 17 | } |
| 18 | |
| 19 | #[benchrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/bench:] |
| 20 | fn short_fomatrust-analyzer cargo fomat-macros 0.3.2 short_fomat().(b: &mut Bencherrust-analyzer cargo test https://github.com/rust-lang/rust/library/test bench/Bencher#) { |
| 21 | let world = "world"; |
| 22 | b.iterrust-analyzer cargo test https://github.com/rust-lang/rust/library/test bench/impl#[Bencher]iter().(|| fomatrust-analyzer cargo fomat-macros 0.3.2 fomat!!("Hello, "(black_boxrust-analyzer cargo test https://github.com/rust-lang/rust/library/test bench/black_box().(world))"!") ) |
| 23 | } |
| 24 | |
| 25 | #[benchrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/bench:] |
| 26 | fn short_formatrust-analyzer cargo fomat-macros 0.3.2 short_format().(b: &mut Bencherrust-analyzer cargo test https://github.com/rust-lang/rust/library/test bench/Bencher#) { |
| 27 | let world = "world"; |
| 28 | b.iterrust-analyzer cargo test https://github.com/rust-lang/rust/library/test bench/impl#[Bencher]iter().(|| formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("Hello, {}!", black_boxrust-analyzer cargo test https://github.com/rust-lang/rust/library/test bench/black_box().(world)) ) |
| 29 | } |
| 30 | |
| 31 | #[benchrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/bench:] |
| 32 | fn two_fomatrust-analyzer cargo fomat-macros 0.3.2 two_fomat().(b: &mut Bencherrust-analyzer cargo test https://github.com/rust-lang/rust/library/test bench/Bencher#) { |
| 33 | b.iterrust-analyzer cargo test https://github.com/rust-lang/rust/library/test bench/impl#[Bencher]iter().(|| fomatrust-analyzer cargo fomat-macros 0.3.2 fomat!!("One"(3)(2+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add().2))) |
| 34 | } |
| 35 | |
| 36 | #[benchrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/bench:] |
| 37 | fn two_formatrust-analyzer cargo fomat-macros 0.3.2 two_format().(b: &mut Bencherrust-analyzer cargo test https://github.com/rust-lang/rust/library/test bench/Bencher#) { |
| 38 | b.iterrust-analyzer cargo test https://github.com/rust-lang/rust/library/test bench/impl#[Bencher]iter().(|| formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("One{}{}", 3, 2+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add().2)) |
| 39 | } |
| 40 | |
| 41 | #[benchrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/bench:] |
| 42 | fn three_fomatrust-analyzer cargo fomat-macros 0.3.2 three_fomat().(b: &mut Bencherrust-analyzer cargo test https://github.com/rust-lang/rust/library/test bench/Bencher#) { |
| 43 | b.iterrust-analyzer cargo test https://github.com/rust-lang/rust/library/test bench/impl#[Bencher]iter().(|| fomatrust-analyzer cargo fomat-macros 0.3.2 fomat!!("One"(2)(3)(2+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add().2))) |
| 44 | } |
| 45 | |
| 46 | #[benchrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/bench:] |
| 47 | fn three_formatrust-analyzer cargo fomat-macros 0.3.2 three_format().(b: &mut Bencherrust-analyzer cargo test https://github.com/rust-lang/rust/library/test bench/Bencher#) { |
| 48 | b.iterrust-analyzer cargo test https://github.com/rust-lang/rust/library/test bench/impl#[Bencher]iter().(|| formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("One{}{}{}", 2, 3, 2+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add().2)) |
| 49 | } |
| 50 | |
| 51 | #[benchrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/bench:] |
| 52 | fn long_fomatrust-analyzer cargo fomat-macros 0.3.2 long_fomat().(b: &mut Bencherrust-analyzer cargo test https://github.com/rust-lang/rust/library/test bench/Bencher#) { |
| 53 | let world = "world"; |
| 54 | b.iterrust-analyzer cargo test https://github.com/rust-lang/rust/library/test bench/impl#[Bencher]iter().(|| fomatrust-analyzer cargo fomat-macros 0.3.2 fomat!!( |
| 55 | "Lorem ipsum dolor sit amet, consectetur adipiscing elit. In convallis |
| 56 | ligula nibh, at maximus diam eleifend sit amet. Suspendisse mattis |
| 57 | nisi quis eleifend commodo. Praesent ut dui luctus, ullamcorper felis |
| 58 | et, dictum purus. Nullam elit nunc, dictum ornare arcu vitae, suscipit |
| 59 | pulvinar felis. Donec malesuada sollicitudin arcu, sit amet laoreet |
| 60 | dolor elementum eu. Cras quam augue, feugiat ac imperdiet vel, posuere |
| 61 | et elit. Nunc consequat bibendum dolor at auctor. Cras vel urna |
| 62 | fermentum, viverra est ut, posuere elit. Suspendisse mattis aliquam |
| 63 | tincidunt. |
| 64 | |
| 65 | Pellentesque ac risus eu nunc molestie cursus id in risus. |
| 66 | Pellentesque vel ipsum sed lectus vehicula fermentum vitae vel est. |
| 67 | Phasellus suscipit dolor eu finibus tincidunt. Duis interdum lectus at |
| 68 | interdum viverra. Phasellus in mi dapibus, condimentum ligula at, |
| 69 | rhoncus quam. Morbi pulvinar tortor sit amet fringilla sodales. Duis |
| 70 | feugiat felis ut ante efficitur, vitae consectetur leo luctus. Vivamus |
| 71 | congue, ex vel ullamcorper auctor, quam dolor vulputate purus, quis |
| 72 | dapibus nulla ipsum in ligula. Sed sed vehicula odio. Quisque bibendum |
| 73 | efficitur sodales. In aliquet sollicitudin venenatis. Sed id euismod |
| 74 | nulla. Cras risus ligula, mattis in arcu eu, pulvinar aliquet metus. |
| 75 | Mauris et convallis eros, in tempus sem." |
| 76 | (world)(1)(2)(3)[vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![4]] "!" |
| 77 | ) ) |
| 78 | } |
| 79 | |
| 80 | #[benchrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/bench:] |
| 81 | fn long_formatrust-analyzer cargo fomat-macros 0.3.2 long_format().(b: &mut Bencherrust-analyzer cargo test https://github.com/rust-lang/rust/library/test bench/Bencher#) { |
| 82 | let world = "world"; |
| 83 | b.iterrust-analyzer cargo test https://github.com/rust-lang/rust/library/test bench/impl#[Bencher]iter().(|| formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!( |
| 84 | "Lorem ipsum dolor sit amet, consectetur adipiscing elit. In convallis |
| 85 | ligula nibh, at maximus diam eleifend sit amet. Suspendisse mattis |
| 86 | nisi quis eleifend commodo. Praesent ut dui luctus, ullamcorper felis |
| 87 | et, dictum purus. Nullam elit nunc, dictum ornare arcu vitae, suscipit |
| 88 | pulvinar felis. Donec malesuada sollicitudin arcu, sit amet laoreet |
| 89 | dolor elementum eu. Cras quam augue, feugiat ac imperdiet vel, posuere |
| 90 | et elit. Nunc consequat bibendum dolor at auctor. Cras vel urna |
| 91 | fermentum, viverra est ut, posuere elit. Suspendisse mattis aliquam |
| 92 | tincidunt. |
| 93 | |
| 94 | Pellentesque ac risus eu nunc molestie cursus id in risus. |
| 95 | Pellentesque vel ipsum sed lectus vehicula fermentum vitae vel est. |
| 96 | Phasellus suscipit dolor eu finibus tincidunt. Duis interdum lectus at |
| 97 | interdum viverra. Phasellus in mi dapibus, condimentum ligula at, |
| 98 | rhoncus quam. Morbi pulvinar tortor sit amet fringilla sodales. Duis |
| 99 | feugiat felis ut ante efficitur, vitae consectetur leo luctus. Vivamus |
| 100 | congue, ex vel ullamcorper auctor, quam dolor vulputate purus, quis |
| 101 | dapibus nulla ipsum in ligula. Sed sed vehicula odio. Quisque bibendum |
| 102 | efficitur sodales. In aliquet sollicitudin venenatis. Sed id euismod |
| 103 | nulla. Cras risus ligula, mattis in arcu eu, pulvinar aliquet metus. |
| 104 | Mauris et convallis eros, in tempus sem.{}{}{}{}{:?}!", |
| 105 | world, 1, 2, 3, vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![4] |
| 106 | ) ) |
| 107 | } |