Giter Club home page Giter Club logo

bytecounttest's Introduction

bytecounttest

This uses quickcheck to verify the two implementations offered by bytecount are compatible. It also includes Daniel Lemire's C implementation of newline counting algorithms and some benchmarks. To run them use RUSTFLAGS="-C target-cpu=native" cargo bench. This will likely fail if your architecture does not support AVX2.

Example for benchmarks

test bench_count               ... bench:          29 ns/iter (+/- 1)
test bench_naive_count         ... bench:         415 ns/iter (+/- 6)
test bench_newlinecount_avx    ... bench:          55 ns/iter (+/- 0)
test bench_newlinecount_avxu   ... bench:          40 ns/iter (+/- 0)
test bench_newlinecount_avxuu  ... bench:          56 ns/iter (+/- 2)
test bench_newlinecount_basic  ... bench:       1,873 ns/iter (+/- 44)
test bench_newlinecount_memchr ... bench:         406 ns/iter (+/- 5)
test bench_newlinecount_swar   ... bench:         365 ns/iter (+/- 7)

Example for a quickcheck failure

running 2 tests
test tests::issue_found_by_quickcheck ... FAILED
test tests::quickcheck ... FAILED

failures:

---- tests::issue_found_by_quickcheck stdout ----
    thread 'tests::issue_found_by_quickcheck' panicked at 'assertion failed: `(left == right)` (left: `2`, right: `1`)', src/lib.rs:33
    note: Run with `RUST_BACKTRACE=1` for a backtrace.

    ---- tests::quickcheck stdout ----
        thread 'tests::quickcheck' panicked at '[quickcheck] TEST FAILED. Arguments: ([0, 0, 89, 88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 89)', /home/steinberg/.cargo/registry/src/github.com-1ecc6299db9ec823/quickcheck-0.3.1/src/tester.rs:118


        failures:
            tests::issue_found_by_quickcheck
                tests::quickcheck

                test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured

                error: test failed

bytecounttest's People

Contributors

vks avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.