Skip to content

Commit c07c1d7

Browse files
committed
release: 0.2.1
2 parents 2546297 + 226f0f9 commit c07c1d7

8 files changed

Lines changed: 107 additions & 45 deletions

File tree

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
4+
5+
## [0.2.1](https://github.com/Blobfolio/brunch/releases/tag/v0.2.1) - 2021-12-02
6+
7+
### Added
8+
9+
- A demo benchmark (`fn_fib`).
10+
11+
### Changed
12+
13+
- The list passed to the `brunch::benches!` macro may now include a trailing comma.
14+
15+
16+
317
## [0.2.0](https://github.com/Blobfolio/brunch/releases/tag/v0.2.0) - 2021-10-21
418

519
### Added

CREDITS.md

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,15 @@ License details for project dependencies are listed below.
44

55
## Overview of Licenses:
66

7-
* Apache License 2.0 (2)
7+
* Apache License 2.0 (3)
88
* Do What The F*ck You Want To Public License (1)
9-
10-
119
## Complete Licenses:
1210

1311
### Apache License 2.0
1412

1513
**Used By:**
1614

17-
* [ryu 1.0.5](https://github.com/dtolnay/ryu)
18-
19-
15+
* [ryu 1.0.6](https://github.com/dtolnay/ryu)
2016
```
2117
Apache License
2218
Version 2.0, January 2004
@@ -226,18 +222,15 @@ License details for project dependencies are listed below.
226222

227223
**Used By:**
228224

229-
* [itoa 0.4.7](https://github.com/dtolnay/itoa)
230-
* [num-integer 0.1.44](https://github.com/rust-num/num-integer)
225+
* [itoa 0.4.8](https://github.com/dtolnay/itoa)
231226
* [num-traits 0.2.14](https://github.com/rust-num/num-traits)
232-
* [proc-macro2 1.0.24](https://github.com/alexcrichton/proc-macro2)
233-
* [quote 1.0.9](https://github.com/dtolnay/quote)
234-
* [serde 1.0.123](https://github.com/serde-rs/serde)
235-
* [serde_derive 1.0.123](https://github.com/serde-rs/serde)
236-
* [serde_json 1.0.64](https://github.com/serde-rs/json)
237-
* [syn 1.0.60](https://github.com/dtolnay/syn)
238-
* [unicode-xid 0.2.1](https://github.com/unicode-rs/unicode-xid)
239-
240-
227+
* [proc-macro2 1.0.32](https://github.com/dtolnay/proc-macro2)
228+
* [quote 1.0.10](https://github.com/dtolnay/quote)
229+
* [serde 1.0.130](https://github.com/serde-rs/serde)
230+
* [serde_derive 1.0.130](https://github.com/serde-rs/serde)
231+
* [serde_json 1.0.72](https://github.com/serde-rs/json)
232+
* [syn 1.0.82](https://github.com/dtolnay/syn)
233+
* [unicode-xid 0.2.2](https://github.com/unicode-rs/unicode-xid)
241234
```
242235
Apache License
243236
Version 2.0, January 2004
@@ -443,14 +436,28 @@ limitations under the License.
443436
444437
```
445438

446-
### Do What The F*ck You Want To Public License
439+
### Apache License 2.0
447440

448441
**Used By:**
449442

450-
* [brunch 0.1.2](https://github.com/Blobfolio/brunch)
451-
* [dactyl 0.1.5](https://github.com/Blobfolio/dactyl)
443+
* [unicode-xid 0.2.2](https://github.com/unicode-rs/unicode-xid)
444+
```
445+
Licensed under the Apache License, Version 2.0
446+
<LICENSE-APACHE or
447+
http://www.apache.org/licenses/LICENSE-2.0> or the MIT
448+
license <LICENSE-MIT or http://opensource.org/licenses/MIT>,
449+
at your option. All files in the project carrying such
450+
notice may not be copied, modified, or distributed except
451+
according to those terms.
452+
453+
```
452454

455+
### Do What The F*ck You Want To Public License
453456

457+
**Used By:**
458+
459+
* [brunch 0.2.1](https://github.com/Blobfolio/brunch)
460+
* [dactyl 0.2.0](https://github.com/Blobfolio/dactyl)
454461
```
455462
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
456463
Version 2, December 2004
@@ -469,4 +476,3 @@ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
469476
```
470477

471478

472-

Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "brunch"
3-
version = "0.2.0"
3+
version = "0.2.1"
44
authors = ["Blobfolio, LLC. <hello@blobfolio.com>"]
55
edition = "2021"
66
rust-version = "1.56"
@@ -29,3 +29,7 @@ serde_json = "1.0.*"
2929
[dependencies.serde]
3030
version = "1.0.*"
3131
features = [ "derive" ]
32+
33+
[[bench]]
34+
name = "fn_fib"
35+
harness = false

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![Documentation](https://docs.rs/brunch/badge.svg)](https://docs.rs/brunch/)
44
[![crates.io](https://img.shields.io/crates/v/brunch.svg)](https://crates.io/crates/brunch)
55
[![Build Status](https://github.com/Blobfolio/brunch/workflows/Build/badge.svg)](https://github.com/Blobfolio/brunch/actions)
6+
[![Dependency Status](https://deps.rs/repo/github/blobfolio/brunch/status.svg)](https://deps.rs/repo/github/blobfolio/brunch
67

78
`Brunch` is a very simple Rust micro-benchmark runner inspired by [`easybench`](https://crates.io/crates/easybench). It has roughly a million times fewer dependencies than [`criterion`](https://crates.io/crates/criterion), does not require nightly, and maintains a "last run" state so can show relative changes benchmark-to-benchmark. The formatting is also quite pretty.
89

@@ -24,7 +25,7 @@ Add `brunch` to your `dev-dependencies` in `Cargo.toml`, like:
2425

2526
```
2627
[dev-dependencies]
27-
brunch = "0.1.*"
28+
brunch = "0.2.*"
2829
```
2930

3031
Benchemarks are also defined in `Cargo.toml` the usual way. Just be sure to set `harness = false`:

benches/fn_fib.rs

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*!
2+
# Benchmark Demo
3+
*/
4+
5+
use brunch::{
6+
Bench,
7+
benches,
8+
};
9+
use std::time::Duration;
10+
11+
12+
13+
fn fibonacci_recursive(len: usize) -> Vec<u32> {
14+
assert!(len > 0, "Length must be non-zero.");
15+
16+
fn fibonacci_idx(n: usize) -> u32 {
17+
if n == 0 { 0 }
18+
else if n < 3 { 1 }
19+
else {
20+
fibonacci_idx(n - 1) + fibonacci_idx(n - 2)
21+
}
22+
}
23+
24+
let mut out = Vec::with_capacity(len);
25+
for n in 0..len {
26+
out.push(fibonacci_idx(n));
27+
}
28+
29+
out
30+
}
31+
32+
fn fibonacci_loop(len: usize) -> Vec<u32> {
33+
assert!(len > 0, "Length must be non-zero.");
34+
35+
let mut out = Vec::with_capacity(len);
36+
if len == 1 { out.push(0); }
37+
else {
38+
out.push(0);
39+
out.push(1);
40+
41+
for n in 2..len {
42+
out.push(out[n - 1] + out[n - 2]);
43+
}
44+
}
45+
46+
out
47+
}
48+
49+
benches!(
50+
Bench::new("fibonacci_recursive", "(30)")
51+
.timed(Duration::from_secs(1))
52+
.with(|| fibonacci_recursive(30_usize)),
53+
54+
Bench::new("fibonacci_loop", "(30)")
55+
.timed(Duration::from_secs(1))
56+
.with(|| fibonacci_loop(30_usize)),
57+
);

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ bench BENCH="":
8484
@credits:
8585
# Update CREDITS.html.
8686
cargo about \
87-
-m "{{ justfile_directory() }}/Cargo.toml" \
8887
generate \
88+
-m "{{ justfile_directory() }}/Cargo.toml" \
8989
"{{ release_dir }}/credits/about.hbs" > "{{ justfile_directory() }}/CREDITS.md"
9090

9191
just _fix-chown "{{ justfile_directory() }}/CREDITS.md"

src/lib.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,6 @@ This crate is still under heavy development. It is ~~subject to~~ going to chang
1515
1616
1717
18-
## Installation
19-
20-
Add `brunch` to your `dev-dependencies` in `Cargo.toml`, like:
21-
22-
```ignore
23-
[dev-dependencies]
24-
brunch = "0.1.*"
25-
```
26-
27-
Benchemarks are also defined in `Cargo.toml` the usual way. Just be sure to set `harness = false`:
28-
29-
```ignore
30-
[[bench]]
31-
name = "encode"
32-
harness = false
33-
```
34-
35-
36-
3718
## Usage
3819
3920
Setup is currently simple if primitive, requiring you drop a call to the [`benches`] macro in the benchmark file. It will generate a `main()` method, run the supplied benchmarks, and give you the results.
@@ -101,7 +82,6 @@ There are currently three styles of callback:
10182
#![allow(clippy::module_name_repetitions)]
10283

10384

104-
10585
mod bench;
10686
#[macro_use]
10787
mod macros;

src/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
/// );
3030
/// ```
3131
macro_rules! benches {
32-
($($benches:expr),+) => {
32+
($($benches:expr),+ $(,)?) => {
3333
/// # Benchmarks!
3434
fn main() {
3535
// This can take a while; give 'em a message of hope.

0 commit comments

Comments
 (0)