Giter Club home page Giter Club logo

cppbenchmark's People

Contributors

chronoxor avatar testpersonal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cppbenchmark's Issues

Don't have build directory

In README.md

How to build?
Linux
cd build
./unix.sh

don't have build directory and don't have unix.sh in the workspace.

The sort example kinda does not make sense

I am browsing the examples and putting things together, and noticed, that the sort example does not really make sense.

Each sort class inheriting from the SortFixture calls Initialize at the beginning of an attempt, which populates the items, but then in each Run called during an attempt, the items are not changed. So the first Run sorts the items and then every subsequent run has the items already sorted.

Windows linker errors

Hello,
I managed to build the library on my machine with the build/vst.bat script, seems fine.

I tried to link with the library in my C++ console application project, I added include directories - CppBenchmark/Include and lib directories CppBenchmark/bin and added cppbenchmark.lib to my linker settings.

Then to my main.cpp file i just copied some of your examples - the random.cpp one, but when I compile, I get linker errors. Some unersolved symbols in file cppbenchmark.lib(launcher_console.obj) - optparse::OptionParser::print_help(), optparse::OptionParser::error(),optparse::OptionParser::parse_args() and others.

And in file cppbenchmark.lib(phase_metrics.obj) - unresolved symbols hdr_init, hdr_close, hdr_record_values, hrd_min, etc...

Do I need to link other libraries to my project as well?
I am on Win 10, VS 2019

Thanks

fatal error: benchmark/cppbenchmark.h: No such file or directory

I build CppBenchmark library and put libcppbenchmark.a into /usr/lib/, then I try to compile serialize.cpp with flag -lcppbenchmark under FastBinaryEncoding/performance/, but it turns out an error like this:
serialize.cpp:5:10: fatal error: benchmark/cppbenchmark.h: No such file or directory
5 | #include "benchmark/cppbenchmark.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
What should I do?

mpsc-queue.hpp has issue

When using std::aligned_storage, you must explicitly call constructor and destructors on the "reinterpreted_cast"'d object (with placement new, and explicit output->~T() call).

In all case, std::aligned_storage is not required in this file, since the compiler will ensure that the structure is correctly aligned anyway.
By default, unless you pragma pack your structure (which is not the case here), the compiler will ensure the structure is aligned with respect to its largest field's alignment requirement, and that's exactly what you get with the std::aligned_storage code that's written.

benchmarking sub-us time makes no sense due to time precision

I'm not sure what functionality the fpu example is trying to demonstrate but I think it makes no sense. clock_gettime is being used to get the timestamp used for time calculation, but this function itself takes ~1us, which means it should not be used to benchmark sub-us activities like simple floating point operations in this example. As shown in the following example:

#include <cmath>
#include <ctime>

#include "benchmark/cppbenchmark.h"

BENCHMARK("empty", CppBenchmark::Settings().Attempts(2).Duration(5)) {}

BENCHMARK("sin", CppBenchmark::Settings().Attempts(2).Duration(5)) {
  [[maybe_unused]] static double sum = 0;
  sum += sin(123.456);
}

BENCHMARK("timestamp", CppBenchmark::Settings().Attempts(2).Duration(5)) {
  System::Timestamp();
}

BENCHMARK_MAIN()

image

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.