Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Benchmarks comparing `feature/input_trait` with `experiment/impl_trait`

experiment/impl_trait is essentially a reimplementation of all the parsers and combinators using the same baseline code as feature/input_trait. The feature/input_trait is intended to be chomp 0.3, and experiment/impl_trait either 1.0 or maybe a new crate chomp2 (useful since feature/input_trait still works on stable while experiment/impl_trait requires the latest nightly version of rustc).

Both share the same reposiotory and dependencies, just two different branches. Same code is used for both tests, with slight adjustment for how parsers are structured.

rustc --version
rustc 1.13.0-nightly (1576de0ce 2016-08-21)

experiment/impl_trait

     Running target/release/combinators-cdf3adc173ec45e9

running 9 tests
test count_vec_10k                  ... bench:       6,802 ns/iter (+/- 2,478)
test count_vec_10k_maybe_incomplete ... bench:       6,094 ns/iter (+/- 2,092)
test count_vec_1k                   ... bench:         725 ns/iter (+/- 265)
test many1_vec_10k                  ... bench:       6,576 ns/iter (+/- 1,741)
test many1_vec_10k_maybe_incomplete ... bench:       6,590 ns/iter (+/- 2,868)
test many1_vec_1k                   ... bench:         958 ns/iter (+/- 128)
test many_vec_10k                   ... bench:       6,560 ns/iter (+/- 918)
test many_vec_10k_maybe_incomplete  ... bench:       6,641 ns/iter (+/- 2,140)
test many_vec_1k                    ... bench:         948 ns/iter (+/- 108)

test result: ok. 0 passed; 0 failed; 0 ignored; 9 measured

     Running target/release/http_bench-83b67c29fd2766be

running 4 tests
test multiple_requests      ... bench:      44,617 ns/iter (+/- 1,953)
test single_request         ... bench:         606 ns/iter (+/- 96)
test single_request_large   ... bench:         980 ns/iter (+/- 329)
test single_request_minimal ... bench:         107 ns/iter (+/- 9)

test result: ok. 0 passed; 0 failed; 0 ignored; 4 measured

feature/input_trait

     Running target/release/combinators-cdf3adc173ec45e9

running 9 tests
test count_vec_10k                  ... bench:       6,856 ns/iter (+/- 694)
test count_vec_10k_maybe_incomplete ... bench:       5,887 ns/iter (+/- 1,828)
test count_vec_1k                   ... bench:         724 ns/iter (+/- 106)
test many1_vec_10k                  ... bench:       6,574 ns/iter (+/- 1,518)
test many1_vec_10k_maybe_incomplete ... bench:       6,698 ns/iter (+/- 1,254)
test many1_vec_1k                   ... bench:         961 ns/iter (+/- 164)
test many_vec_10k                   ... bench:       6,609 ns/iter (+/- 1,104)
test many_vec_10k_maybe_incomplete  ... bench:       6,657 ns/iter (+/- 1,750)
test many_vec_1k                    ... bench:         957 ns/iter (+/- 36)

test result: ok. 0 passed; 0 failed; 0 ignored; 9 measured

     Running target/release/http_bench-83b67c29fd2766be

running 4 tests
test multiple_requests      ... bench:      44,681 ns/iter (+/- 5,344)
test single_request         ... bench:         610 ns/iter (+/- 175)
test single_request_large   ... bench:         979 ns/iter (+/- 52)
test single_request_minimal ... bench:         114 ns/iter (+/- 7)

test result: ok. 0 passed; 0 failed; 0 ignored; 4 measured
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.