Skip to content

steveklabnik/fibs

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 

Fibs

Thanks @brianloveswords ❤️

$ cargo build
$ ./target/fibs
$ ./target/fibs2
$ ./target/fibs3

To benchmark:

Cargo doesn't have a bench command yet, so you have to fudge it:

$ cargo test
$ target/tests/fibs1 --bench
$ target/tests/fibs2 --bench
$ target/tests/fibs3 --bench

On my system:

steve@computer:~/tmp/fibs$ target/tests/fibs1 --bench

running 1 test
test bench_fib_of_40000000 ... bench:       624 ns/iter (+/- 10)

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

steve@computer:~/tmp/fibs$ target/tests/fibs2 --bench

running 1 test
test bench_fib_of_40000000 ... bench:       705 ns/iter (+/- 10)

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

steve@computer:~/tmp/fibs$ target/tests/fibs3 --bench

running 1 test
test bench_fib_of_40000000 ... bench:      1194 ns/iter (+/- 31)

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

I am not sure why the last version is slower...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages