├── .gitignore
├── README.md
├── benchmarkLibsTest.sln
├── celeroTest
├── Celero-master.zip
├── Celero-master
│ ├── .gitattributes
│ ├── .gitignore
│ ├── .travis.yml
│ ├── ALL_BUILD.vcxproj
│ ├── ALL_BUILD.vcxproj.filters
│ ├── CMakeLists.txt
│ ├── CONTRIBUTING.md
│ ├── CeleroProject.sln
│ ├── Doxyfile
│ ├── INSTALL.vcxproj
│ ├── INSTALL.vcxproj.filters
│ ├── README.md
│ ├── ZERO_CHECK.vcxproj
│ ├── ZERO_CHECK.vcxproj.filters
│ ├── celero.vcxproj
│ ├── celero.vcxproj.filters
│ ├── experiments
│ │ ├── CMakeLists.txt
│ │ ├── DemoDoNotOptimizeAway
│ │ │ ├── CMakeLists.txt
│ │ │ └── DemoDoNotOptimizeAway.cpp
│ │ ├── DemoFileWrite
│ │ │ ├── CMakeLists.txt
│ │ │ └── DemoFileWrite.cpp
│ │ ├── DemoMultithread
│ │ │ ├── CMakeLists.txt
│ │ │ └── DemoMultithread.cpp
│ │ ├── DemoSimple
│ │ │ ├── CMakeLists.txt
│ │ │ └── DemoSimple.cpp
│ │ ├── DemoSimpleJUnit
│ │ │ ├── CMakeLists.txt
│ │ │ └── DemoSimpleJUnit.cpp
│ │ ├── DemoSleep
│ │ │ ├── CMakeLists.txt
│ │ │ └── DemoSleep.cpp
│ │ ├── DemoToString
│ │ │ ├── CMakeLists.txt
│ │ │ └── DemoToString.cpp
│ │ ├── DemoTransform
│ │ │ ├── CMakeLists.txt
│ │ │ └── DemoTransform.cpp
│ │ ├── ExperimentCostOfPimpl
│ │ │ ├── CMakeLists.txt
│ │ │ └── ExperimentCostOfPimpl.cpp
│ │ ├── ExperimentParameterPassing
│ │ │ ├── CMakeLists.txt
│ │ │ └── ExperimentParameterPassing.cpp
│ │ ├── ExperimentSimpleComparison
│ │ │ ├── CMakeLists.txt
│ │ │ └── ExperimentSimpleComparison.cpp
│ │ └── ExperimentSortingRandomInts
│ │ │ ├── CMakeLists.txt
│ │ │ └── ExperimentSortingRandomInts.cpp
│ ├── include
│ │ └── celero
│ │ │ ├── Archive.h
│ │ │ ├── Benchmark.h
│ │ │ ├── Callbacks.h
│ │ │ ├── Celero.h
│ │ │ ├── CommandLine.h
│ │ │ ├── Console.h
│ │ │ ├── Distribution.h
│ │ │ ├── Executor.h
│ │ │ ├── Experiment.h
│ │ │ ├── Export.h
│ │ │ ├── Factory.h
│ │ │ ├── FileReader.h
│ │ │ ├── GenericFactory.h
│ │ │ ├── JUnit.h
│ │ │ ├── Pimpl.h
│ │ │ ├── PimplImpl.h
│ │ │ ├── Print.h
│ │ │ ├── Result.h
│ │ │ ├── ResultTable.h
│ │ │ ├── Statistics.h
│ │ │ ├── TestFixture.h
│ │ │ ├── TestVector.h
│ │ │ ├── ThreadLocal.h
│ │ │ ├── ThreadTestFixture.h
│ │ │ ├── Timer.h
│ │ │ └── Utilities.h
│ ├── license.txt
│ └── src
│ │ ├── Archive.cpp
│ │ ├── Benchmark.cpp
│ │ ├── Callbacks.cpp
│ │ ├── Celero.cpp
│ │ ├── Console.cpp
│ │ ├── Distribution.cpp
│ │ ├── Executor.cpp
│ │ ├── Experiment.cpp
│ │ ├── JUnit.cpp
│ │ ├── Print.cpp
│ │ ├── Result.cpp
│ │ ├── ResultTable.cpp
│ │ ├── Statistics.cpp
│ │ ├── TestFixture.cpp
│ │ ├── TestVector.cpp
│ │ ├── ThreadTestFixture.cpp
│ │ ├── Timer.cpp
│ │ └── Utilities.cpp
├── Release
│ └── celeroTest.log
├── celeroCompressBools.cpp
├── celeroCompressBools.vcxproj
├── celeroParticles.cpp
├── celeroParticles.filters
├── celeroParticles.vcxproj
├── celeroTest.cpp
├── celeroTest.vcxproj
├── celeroTest.vcxproj.filters
└── celeroTest.vcxproj.user
├── commonTest.h
├── googleBenchmarkTest
├── benchmark-master32
│ ├── .gitignore
│ ├── .travis-setup.sh
│ ├── .travis.yml
│ ├── .ycm_extra_conf.py
│ ├── ALL_BUILD.vcxproj
│ ├── ALL_BUILD.vcxproj.filters
│ ├── AUTHORS
│ ├── CMakeLists.txt
│ ├── CONTRIBUTING.md
│ ├── CONTRIBUTORS
│ ├── INSTALL.vcxproj
│ ├── INSTALL.vcxproj.filters
│ ├── LICENSE
│ ├── README.md
│ ├── RUN_TESTS.vcxproj
│ ├── RUN_TESTS.vcxproj.filters
│ ├── Win32
│ │ └── MinSizeRel
│ │ │ └── ZERO_CHECK
│ │ │ └── ZERO_CHECK.tlog
│ │ │ ├── ZERO_CHECK.lastbuildstate
│ │ │ ├── custombuild.command.1.tlog
│ │ │ ├── custombuild.read.1.tlog
│ │ │ └── custombuild.write.1.tlog
│ ├── ZERO_CHECK.vcxproj
│ ├── ZERO_CHECK.vcxproj.filters
│ ├── appveyor.yml
│ ├── benchmark.sln
│ ├── cmake
│ │ ├── AddCXXCompilerFlag.cmake
│ │ ├── CXXFeatureCheck.cmake
│ │ ├── GetGitVersion.cmake
│ │ ├── gnu_posix_regex.cpp
│ │ ├── posix_regex.cpp
│ │ ├── std_regex.cpp
│ │ ├── steady_clock.cpp
│ │ └── thread_safety_attributes.cpp
│ ├── include
│ │ └── benchmark
│ │ │ ├── benchmark.h
│ │ │ ├── benchmark_api.h
│ │ │ ├── macros.h
│ │ │ └── reporter.h
│ ├── mingw.py
│ ├── src
│ │ ├── CMakeLists.txt
│ │ ├── INSTALL.vcxproj
│ │ ├── INSTALL.vcxproj.filters
│ │ ├── MinSizeRel
│ │ │ └── benchmark.lib
│ │ ├── RUN_TESTS.vcxproj
│ │ ├── RUN_TESTS.vcxproj.filters
│ │ ├── arraysize.h
│ │ ├── benchmark.cc
│ │ ├── benchmark.vcxproj
│ │ ├── benchmark.vcxproj.filters
│ │ ├── check.h
│ │ ├── colorprint.cc
│ │ ├── colorprint.h
│ │ ├── commandlineflags.cc
│ │ ├── commandlineflags.h
│ │ ├── console_reporter.cc
│ │ ├── csv_reporter.cc
│ │ ├── cycleclock.h
│ │ ├── internal_macros.h
│ │ ├── json_reporter.cc
│ │ ├── log.cc
│ │ ├── log.h
│ │ ├── mutex.h
│ │ ├── re.h
│ │ ├── re_posix.cc
│ │ ├── re_std.cc
│ │ ├── reporter.cc
│ │ ├── sleep.cc
│ │ ├── sleep.h
│ │ ├── stat.h
│ │ ├── string_util.cc
│ │ ├── string_util.h
│ │ ├── sysinfo.cc
│ │ ├── sysinfo.h
│ │ ├── walltime.cc
│ │ └── walltime.h
│ └── test
│ │ ├── CMakeLists.txt
│ │ ├── INSTALL.vcxproj
│ │ ├── INSTALL.vcxproj.filters
│ │ ├── RUN_TESTS.vcxproj
│ │ ├── RUN_TESTS.vcxproj.filters
│ │ ├── basic_test.cc
│ │ ├── basic_test.vcxproj
│ │ ├── basic_test.vcxproj.filters
│ │ ├── benchmark_test.cc
│ │ ├── benchmark_test.vcxproj
│ │ ├── benchmark_test.vcxproj.filters
│ │ ├── cxx03_test.cc
│ │ ├── cxx03_test.vcxproj
│ │ ├── cxx03_test.vcxproj.filters
│ │ ├── filter_test.cc
│ │ ├── filter_test.vcxproj
│ │ ├── filter_test.vcxproj.filters
│ │ ├── fixture_test.cc
│ │ ├── fixture_test.vcxproj
│ │ ├── fixture_test.vcxproj.filters
│ │ ├── map_test.cc
│ │ ├── map_test.vcxproj
│ │ ├── map_test.vcxproj.filters
│ │ ├── options_test.cc
│ │ ├── options_test.vcxproj
│ │ └── options_test.vcxproj.filters
├── googleBenchmarkParticles.cpp
├── googleBenchmarkParticles.vcxproj
├── googleBenchmarkTest.cpp
└── googleBenchmarkTest.vcxproj
├── hayaiTest
├── hayai-master
│ ├── .gitignore
│ ├── .travis.yml
│ ├── AUTHORS.md
│ ├── CMakeLists.txt
│ ├── LICENSE.md
│ ├── README.md
│ ├── Vagrantfile
│ ├── debian
│ │ ├── compat
│ │ ├── control
│ │ ├── dirs
│ │ ├── libhayai-dev.dirs
│ │ ├── libhayai-dev.install
│ │ ├── rules
│ │ └── source
│ │ │ └── format
│ ├── hayai-config.cmake.in
│ ├── sample
│ │ ├── CMakeLists.txt
│ │ ├── delivery_man.hpp
│ │ ├── delivery_man_benchmark.cpp
│ │ ├── delivery_man_benchmark_parameterized.cpp
│ │ ├── delivery_man_benchmark_parameterized_with_fixture.cpp
│ │ ├── delivery_man_benchmark_with_fixture.cpp
│ │ └── delivery_man_sleep.cpp
│ ├── script
│ │ ├── clean
│ │ ├── debianize
│ │ └── travis-cmake
│ ├── src
│ │ ├── CMakeLists.txt
│ │ ├── hayai.hpp
│ │ ├── hayai_benchmarker.hpp
│ │ ├── hayai_clock.hpp
│ │ ├── hayai_compatibility.hpp
│ │ ├── hayai_console.hpp
│ │ ├── hayai_console_outputter.hpp
│ │ ├── hayai_default_test_factory.hpp
│ │ ├── hayai_fixture.hpp
│ │ ├── hayai_json_outputter.hpp
│ │ ├── hayai_junit_xml_outputter.hpp
│ │ ├── hayai_main.hpp
│ │ ├── hayai_outputter.hpp
│ │ ├── hayai_posix_main.cpp
│ │ ├── hayai_test.hpp
│ │ ├── hayai_test_descriptor.hpp
│ │ ├── hayai_test_factory.hpp
│ │ └── hayai_test_result.hpp
│ ├── tests
│ │ ├── CMakeLists.txt
│ │ ├── base.hpp
│ │ └── hayai_test_parameter_descriptor.cpp
│ └── vendor
│ │ └── gtest
│ │ ├── CHANGES
│ │ ├── CMakeLists.txt
│ │ ├── CONTRIBUTORS
│ │ ├── LICENSE
│ │ ├── Makefile.am
│ │ ├── Makefile.in
│ │ ├── README
│ │ ├── aclocal.m4
│ │ ├── build-aux
│ │ ├── config.guess
│ │ ├── config.h.in
│ │ ├── config.sub
│ │ ├── depcomp
│ │ ├── install-sh
│ │ ├── ltmain.sh
│ │ └── missing
│ │ ├── cmake
│ │ └── internal_utils.cmake
│ │ ├── codegear
│ │ ├── gtest.cbproj
│ │ ├── gtest.groupproj
│ │ ├── gtest_all.cc
│ │ ├── gtest_link.cc
│ │ ├── gtest_main.cbproj
│ │ └── gtest_unittest.cbproj
│ │ ├── configure
│ │ ├── configure.ac
│ │ ├── fused-src
│ │ └── gtest
│ │ │ ├── gtest-all.cc
│ │ │ ├── gtest.h
│ │ │ └── gtest_main.cc
│ │ ├── include
│ │ └── gtest
│ │ │ ├── gtest-death-test.h
│ │ │ ├── gtest-message.h
│ │ │ ├── gtest-param-test.h
│ │ │ ├── gtest-param-test.h.pump
│ │ │ ├── gtest-printers.h
│ │ │ ├── gtest-spi.h
│ │ │ ├── gtest-test-part.h
│ │ │ ├── gtest-typed-test.h
│ │ │ ├── gtest.h
│ │ │ ├── gtest_pred_impl.h
│ │ │ ├── gtest_prod.h
│ │ │ └── internal
│ │ │ ├── gtest-death-test-internal.h
│ │ │ ├── gtest-filepath.h
│ │ │ ├── gtest-internal.h
│ │ │ ├── gtest-linked_ptr.h
│ │ │ ├── gtest-param-util-generated.h
│ │ │ ├── gtest-param-util-generated.h.pump
│ │ │ ├── gtest-param-util.h
│ │ │ ├── gtest-port.h
│ │ │ ├── gtest-string.h
│ │ │ ├── gtest-tuple.h
│ │ │ ├── gtest-tuple.h.pump
│ │ │ ├── gtest-type-util.h
│ │ │ └── gtest-type-util.h.pump
│ │ ├── m4
│ │ ├── acx_pthread.m4
│ │ ├── gtest.m4
│ │ ├── libtool.m4
│ │ ├── ltoptions.m4
│ │ ├── ltsugar.m4
│ │ ├── ltversion.m4
│ │ └── lt~obsolete.m4
│ │ ├── msvc
│ │ ├── gtest-md.sln
│ │ ├── gtest-md.vcproj
│ │ ├── gtest.sln
│ │ ├── gtest.vcproj
│ │ ├── gtest_main-md.vcproj
│ │ ├── gtest_main.vcproj
│ │ ├── gtest_prod_test-md.vcproj
│ │ ├── gtest_prod_test.vcproj
│ │ ├── gtest_unittest-md.vcproj
│ │ └── gtest_unittest.vcproj
│ │ ├── samples
│ │ ├── prime_tables.h
│ │ ├── sample1.cc
│ │ ├── sample1.h
│ │ ├── sample10_unittest.cc
│ │ ├── sample1_unittest.cc
│ │ ├── sample2.cc
│ │ ├── sample2.h
│ │ ├── sample2_unittest.cc
│ │ ├── sample3-inl.h
│ │ ├── sample3_unittest.cc
│ │ ├── sample4.cc
│ │ ├── sample4.h
│ │ ├── sample4_unittest.cc
│ │ ├── sample5_unittest.cc
│ │ ├── sample6_unittest.cc
│ │ ├── sample7_unittest.cc
│ │ ├── sample8_unittest.cc
│ │ └── sample9_unittest.cc
│ │ ├── scripts
│ │ ├── fuse_gtest_files.py
│ │ ├── gen_gtest_pred_impl.py
│ │ ├── gtest-config.in
│ │ └── pump.py
│ │ ├── src
│ │ ├── gtest-all.cc
│ │ ├── gtest-death-test.cc
│ │ ├── gtest-filepath.cc
│ │ ├── gtest-internal-inl.h
│ │ ├── gtest-port.cc
│ │ ├── gtest-printers.cc
│ │ ├── gtest-test-part.cc
│ │ ├── gtest-typed-test.cc
│ │ ├── gtest.cc
│ │ └── gtest_main.cc
│ │ ├── test
│ │ ├── gtest-death-test_ex_test.cc
│ │ ├── gtest-death-test_test.cc
│ │ ├── gtest-filepath_test.cc
│ │ ├── gtest-linked_ptr_test.cc
│ │ ├── gtest-listener_test.cc
│ │ ├── gtest-message_test.cc
│ │ ├── gtest-options_test.cc
│ │ ├── gtest-param-test2_test.cc
│ │ ├── gtest-param-test_test.cc
│ │ ├── gtest-param-test_test.h
│ │ ├── gtest-port_test.cc
│ │ ├── gtest-printers_test.cc
│ │ ├── gtest-test-part_test.cc
│ │ ├── gtest-tuple_test.cc
│ │ ├── gtest-typed-test2_test.cc
│ │ ├── gtest-typed-test_test.cc
│ │ ├── gtest-typed-test_test.h
│ │ ├── gtest-unittest-api_test.cc
│ │ ├── gtest_all_test.cc
│ │ ├── gtest_break_on_failure_unittest.py
│ │ ├── gtest_break_on_failure_unittest_.cc
│ │ ├── gtest_catch_exceptions_test.py
│ │ ├── gtest_catch_exceptions_test_.cc
│ │ ├── gtest_color_test.py
│ │ ├── gtest_color_test_.cc
│ │ ├── gtest_env_var_test.py
│ │ ├── gtest_env_var_test_.cc
│ │ ├── gtest_environment_test.cc
│ │ ├── gtest_filter_unittest.py
│ │ ├── gtest_filter_unittest_.cc
│ │ ├── gtest_help_test.py
│ │ ├── gtest_help_test_.cc
│ │ ├── gtest_list_tests_unittest.py
│ │ ├── gtest_list_tests_unittest_.cc
│ │ ├── gtest_main_unittest.cc
│ │ ├── gtest_no_test_unittest.cc
│ │ ├── gtest_output_test.py
│ │ ├── gtest_output_test_.cc
│ │ ├── gtest_output_test_golden_lin.txt
│ │ ├── gtest_pred_impl_unittest.cc
│ │ ├── gtest_premature_exit_test.cc
│ │ ├── gtest_prod_test.cc
│ │ ├── gtest_repeat_test.cc
│ │ ├── gtest_shuffle_test.py
│ │ ├── gtest_shuffle_test_.cc
│ │ ├── gtest_sole_header_test.cc
│ │ ├── gtest_stress_test.cc
│ │ ├── gtest_test_utils.py
│ │ ├── gtest_throw_on_failure_ex_test.cc
│ │ ├── gtest_throw_on_failure_test.py
│ │ ├── gtest_throw_on_failure_test_.cc
│ │ ├── gtest_uninitialized_test.py
│ │ ├── gtest_uninitialized_test_.cc
│ │ ├── gtest_unittest.cc
│ │ ├── gtest_xml_outfile1_test_.cc
│ │ ├── gtest_xml_outfile2_test_.cc
│ │ ├── gtest_xml_outfiles_test.py
│ │ ├── gtest_xml_output_unittest.py
│ │ ├── gtest_xml_output_unittest_.cc
│ │ ├── gtest_xml_test_utils.py
│ │ ├── production.cc
│ │ └── production.h
│ │ └── xcode
│ │ ├── Config
│ │ ├── DebugProject.xcconfig
│ │ ├── FrameworkTarget.xcconfig
│ │ ├── General.xcconfig
│ │ ├── ReleaseProject.xcconfig
│ │ ├── StaticLibraryTarget.xcconfig
│ │ └── TestTarget.xcconfig
│ │ ├── Resources
│ │ └── Info.plist
│ │ ├── Samples
│ │ └── FrameworkSample
│ │ │ ├── Info.plist
│ │ │ ├── WidgetFramework.xcodeproj
│ │ │ └── project.pbxproj
│ │ │ ├── runtests.sh
│ │ │ ├── widget.cc
│ │ │ ├── widget.h
│ │ │ └── widget_test.cc
│ │ ├── Scripts
│ │ ├── runtests.sh
│ │ └── versiongenerate.py
│ │ └── gtest.xcodeproj
│ │ └── project.pbxproj
├── hayaiTest.cpp
├── hayaiTest.vcxproj
└── hayaiTest.vcxproj.filters
├── noniusTest
├── nonius-1.1.2
│ └── nonius
│ │ ├── doc
│ │ ├── authoring-benchmarks.html
│ │ ├── css
│ │ │ ├── print.css
│ │ │ ├── pygment_trac.css
│ │ │ └── stylesheet.css
│ │ ├── favicon.png
│ │ ├── images
│ │ │ ├── body-bg.png
│ │ │ ├── highlight-bg.jpg
│ │ │ └── hr.png
│ │ └── index.html
│ │ └── nonius.h++
├── noniusCompressBools.cpp
├── noniusCompressBools.vcxproj
├── noniusParticles.cpp
├── noniusParticles.filters
├── noniusParticles.vcxproj
├── noniusTest.cpp
├── noniusTest.vcxproj
└── noniusTest.vcxproj.filters
└── particles.h
/README.md:
--------------------------------------------------------------------------------
1 | # benchmarkLibsTest
2 | Micro Benchmark library tests
3 | Library tested: Nonius, Hayai, Celero, Google Benchmark
4 |
5 | Full description can be found in my blog post: http://www.bfilipek.com/2016/01/micro-benchmarking-libraries-for-c.html
6 |
7 | Additional posts: http://www.bfilipek.com/2016/02/revisiting-old-benchmark-vector-of.html
8 |
9 | Google Benchmark lib: http://www.bfilipek.com/2016/05/google-benchmark-library.html
10 |
11 | Packing bools experiment: http://www.bfilipek.com/2017/04/packing-bools.html
12 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fenbf/benchmarkLibsTest/35cc3c702a929dd9156e10a62e4a15682a1b5c97/celeroTest/Celero-master.zip
--------------------------------------------------------------------------------
/celeroTest/Celero-master/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 | *.sln merge=union
7 | *.csproj merge=union
8 | *.vbproj merge=union
9 | *.fsproj merge=union
10 | *.dbproj merge=union
11 |
12 | # Standard to msysgit
13 | *.doc diff=astextplain
14 | *.DOC diff=astextplain
15 | *.docx diff=astextplain
16 | *.DOCX diff=astextplain
17 | *.dot diff=astextplain
18 | *.DOT diff=astextplain
19 | *.pdf diff=astextplain
20 | *.PDF diff=astextplain
21 | *.rtf diff=astextplain
22 | *.RTF diff=astextplain
23 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/.travis.yml:
--------------------------------------------------------------------------------
1 | language: cpp
2 | compiler:
3 | - gcc
4 | # - clang # This is not currently working because it seems to still be looking at GCC include directories.
5 |
6 | before_install:
7 | - echo "yes" | sudo add-apt-repository ppa:kalakris/cmake
8 | - echo "yes" | sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
9 | - sudo apt-get update -qq
10 | - sudo apt-get install -qq
11 | - sudo apt-get install cmake
12 | # g++4.8.1
13 | - if [ "$CXX" == "g++" ]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; fi
14 |
15 | # clang 3.4
16 | - if [ "$CXX" == "clang++" ]; then sudo add-apt-repository -y ppa:h-rayflood/llvm; fi
17 |
18 | - sudo apt-get update -qq
19 |
20 | install:
21 | # g++4.8.1
22 | - if [ "$CXX" = "g++" ]; then sudo apt-get install -qq g++-4.8; fi
23 | - if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
24 | - if [ "$CXX" = "g++" ]; then sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90; fi
25 | - if [ "$CXX" = "g++" ]; then sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 90; fi
26 | - if [ "$CXX" = "g++" ]; then sudo apt-get install libstdc++-4.8-dev; fi
27 |
28 | # clang 3.4
29 | - if [ "$CXX" == "clang++" ]; then sudo apt-get install --allow-unauthenticated -qq clang-3.4; fi
30 | - if [ "$CXX" == "clang++" ]; then export CXX="clang++-3.4"; fi
31 |
32 | # command to run tests
33 | script:
34 | - cd /home/travis/build/DigitalInBlue/Celero
35 | - pwd
36 | - mkdir build
37 | - pwd
38 | - cd build
39 | - pwd
40 | - cmake ..
41 | - ls
42 | - make
43 |
44 | branches:
45 | only:
46 | - master
47 | - develop
--------------------------------------------------------------------------------
/celeroTest/Celero-master/ALL_BUILD.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/INSTALL.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CMake Rules
6 |
7 |
8 |
9 |
10 | {F0E2576A-270E-3513-867B-4825C4CC51FB}
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/ZERO_CHECK.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CMake Rules
6 |
7 |
8 |
9 |
10 | {F0E2576A-270E-3513-867B-4825C4CC51FB}
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/experiments/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | if(CELERO_ENABLE_EXPERIMENTS)
2 | # Run the SUBDIRLIST macro located in the top level CMakeLists.txt file.
3 | FILE(GLOB _ALL_FILES ./ ./*)
4 | FOREACH(_FILE ${_ALL_FILES})
5 | IF(IS_DIRECTORY ${_FILE})
6 | ADD_SUBDIRECTORY(${_FILE})
7 | ENDIF()
8 | ENDFOREACH()
9 | endif()
10 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/experiments/DemoFileWrite/DemoFileWrite.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | CELERO_MAIN
4 |
5 | class BaseFixture : public celero::TestFixture
6 | {
7 | public:
8 | std::vector> getExperimentValues() const override
9 | {
10 | std::vector> bufferSizes;
11 | bufferSizes.push_back(std::pair(32, 0));
12 | bufferSizes.push_back(std::pair(64, 0));
13 | bufferSizes.push_back(std::pair(128, 0));
14 | bufferSizes.push_back(std::pair(256, 0));
15 | bufferSizes.push_back(std::pair(512, 0));
16 | bufferSizes.push_back(std::pair(1024, 0));
17 | bufferSizes.push_back(std::pair(2048, 0));
18 | bufferSizes.push_back(std::pair(4096, 0));
19 | return bufferSizes;
20 | }
21 |
22 | // Scale the experiment values to megabytes.
23 | double getExperimentValueResultScale() const override
24 | {
25 | return 1024.0 * 1024.0;
26 | }
27 |
28 | void setUp(int64_t experimentValue) override
29 | {
30 | for(auto i = 0; i < experimentValue; ++i)
31 | {
32 | this->buffer.push_back(rand() % 256);
33 | }
34 | }
35 |
36 | void tearDown() override
37 | {
38 | this->buffer.clear();
39 | }
40 |
41 | std::vector buffer;
42 | };
43 |
44 | class StdFileFixture : public BaseFixture
45 | {
46 | public:
47 | void setUp(int64_t experimentValue) override
48 | {
49 | BaseFixture::setUp(experimentValue);
50 | this->file = fopen("FileWrite.out", "wb");
51 | }
52 |
53 | void tearDown() override
54 | {
55 | fclose(this->file);
56 | BaseFixture::tearDown();
57 | }
58 |
59 | FILE* file;
60 | };
61 |
62 | BASELINE_F(FileWrite, fwrite, StdFileFixture, 30, 5000)
63 | {
64 | fwrite(buffer.data(), sizeof(char), buffer.size() * sizeof(char), file);
65 | }
66 |
67 | BENCHMARK_F(FileWrite, fwrite_with_fflush, StdFileFixture, 30, 5000)
68 | {
69 | fwrite(buffer.data(), sizeof(char), buffer.size() * sizeof(char), file);
70 | fflush(file);
71 | }
72 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/experiments/DemoMultithread/DemoMultithread.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include
4 | #include
5 |
6 | CELERO_MAIN
7 |
8 | class BaseFixture : public celero::ThreadTestFixture
9 | {
10 | public:
11 | int counter;
12 |
13 | void setUp(int64_t) override
14 | {
15 | this->counter = 0;
16 | }
17 | };
18 |
19 | class AtomicFixture : public celero::ThreadTestFixture
20 | {
21 | public:
22 | std::atomic counter;
23 |
24 | void setUp(int64_t) override
25 | {
26 | this->counter = 0;
27 | }
28 | };
29 |
30 | class MutexFixture : public celero::ThreadTestFixture
31 | {
32 | public:
33 | int counter;
34 | std::mutex mutex;
35 |
36 | void setUp(int64_t) override
37 | {
38 | this->counter = 0;
39 | }
40 | };
41 |
42 | BASELINE_T(DemoMultithread, Baseline, BaseFixture, 10, 10000000, 8)
43 | {
44 | ++counter;
45 | }
46 |
47 | BENCHMARK_T(DemoMultithread, Atomic, AtomicFixture, 10, 10000000, 8)
48 | {
49 | ++counter;
50 | }
51 |
52 | BENCHMARK_T(DemoMultithread, Mutex, MutexFixture, 10, 10000000, 8)
53 | {
54 | std::lock_guard lock(mutex);
55 | ++counter;
56 | }
57 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/experiments/DemoSimple/DemoSimple.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include
4 |
5 | #ifndef WIN32
6 | #include
7 | #include
8 | #endif
9 |
10 | ///
11 | /// This is the main(int argc, char** argv) for the entire celero program.
12 | /// You can write your own, or use this macro to insert the standard one into the project.
13 | ///
14 | CELERO_MAIN
15 |
16 | std::random_device RandomDevice;
17 | std::uniform_int_distribution UniformDistribution(0, 1024);
18 |
19 | /// In reality, all of the "Complex" cases take the same amount of time to run.
20 | /// The difference in the results is a product of measurement error.
21 | ///
22 | /// Interestingly, taking the sin of a constant number here resulted in a
23 | /// great deal of optimization in clang and gcc.
24 | BASELINE(DemoSimple, Baseline, 30, 1000000)
25 | {
26 | celero::DoNotOptimizeAway(static_cast(sin(fmod(UniformDistribution(RandomDevice), 3.14159265))));
27 | }
28 |
29 | /// Run a test consisting of 1 sample of 710000 iterations per measurement.
30 | /// There are not enough samples here to likely get a meaningful result.
31 | BENCHMARK(DemoSimple, Complex1, 1, 710000)
32 | {
33 | celero::DoNotOptimizeAway(static_cast(sin(fmod(UniformDistribution(RandomDevice), 3.14159265))));
34 | }
35 |
36 | /// Run a test consisting of 30 samples of 710000 iterations per measurement.
37 | /// There are not enough samples here to get a reasonable measurement
38 | /// It should get a Basline number lower than the previous test.
39 | BENCHMARK(DemoSimple, Complex2, 30, 710000)
40 | {
41 | celero::DoNotOptimizeAway(static_cast(sin(fmod(UniformDistribution(RandomDevice), 3.14159265))));
42 | }
43 |
44 | /// Run a test consisting of 60 samples of 710000 iterations per measurement.
45 | /// There are not enough samples here to get a reasonable measurement
46 | /// It should get a Basline number lower than the previous test.
47 | BENCHMARK(DemoSimple, Complex3, 60, 710000)
48 | {
49 | celero::DoNotOptimizeAway(static_cast(sin(fmod(UniformDistribution(RandomDevice), 3.14159265))));
50 | }
51 |
52 | /// Run a test consisting of 60 samples of 7100000 iterations per measurement.
53 | /// Samples here are much large and there are more of them. Expect a better answer here.
54 | /*
55 | BENCHMARK(DemoSimple, Complex4, 600, 20000000)
56 | {
57 | celero::DoNotOptimizeAway(static_cast(sin(fmod(rand(), 3.14159265))));
58 | }
59 | */
60 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/experiments/DemoSimpleJUnit/DemoSimpleJUnit.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #ifndef WIN32
4 | #include
5 | #include
6 | #endif
7 |
8 | ///
9 | /// This is the main(int argc, char** argv) for the entire celero program.
10 | /// You can write your own, or use this macro to insert the standard one into the project.
11 | ///
12 | CELERO_MAIN
13 |
14 | /// Run an automatic baseline.
15 | /// In reality, all of the "Complex" cases take the same amount of time to run.
16 | /// The difference in the results is a product of measurement error.
17 | BASELINE(DemoSimple, Baseline, 1, 7100000)
18 | {
19 | celero::DoNotOptimizeAway(static_cast(sin(3.14159265)));
20 | }
21 |
22 | /// Run an automatic test.
23 | /// Celero will help make sure enough samples are taken to get a reasonable measurement
24 | BENCHMARK_TEST(DemoSimple, Complex1, 1, 7100000, 1.0)
25 | {
26 | celero::DoNotOptimizeAway(static_cast(sin(fmod(rand(), 3.14159265))));
27 | }
28 |
29 | /// Run a manual test consisting of 1 sample of 7100000 iterations per measurement.
30 | BENCHMARK_TEST(DemoSimple, Complex2, 1, 7100000, 3.71)
31 | {
32 | celero::DoNotOptimizeAway(static_cast(sin(fmod(rand(), 3.14159265))));
33 | }
34 |
35 | /// Run a manual test consisting of 60 samples of 7100000 iterations per measurement.
36 | BENCHMARK_TEST(DemoSimple, Complex3, 60, 7100000, 5.0)
37 | {
38 | celero::DoNotOptimizeAway(static_cast(sin(fmod(rand(), 3.14159265))));
39 | }
40 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/experiments/DemoSleep/DemoSleep.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include
4 | #include
5 |
6 | ///
7 | /// This is the main(int argc, char** argv) for the entire celero program.
8 | /// You can write your own, or use this macro to insert the standard one into the project.
9 | ///
10 | CELERO_MAIN
11 |
12 | BASELINE(DemoSleep, Baseline, 60, 1)
13 | {
14 | std::this_thread::sleep_for(std::chrono::microseconds(100000));
15 | }
16 |
17 | BENCHMARK(DemoSleep, HalfBaseline, 60, 1)
18 | {
19 | std::this_thread::sleep_for(std::chrono::microseconds(50000));
20 | }
21 |
22 | BENCHMARK(DemoSleep, TwiceBaseline, 60, 1)
23 | {
24 | std::this_thread::sleep_for(std::chrono::microseconds(200000));
25 | }
26 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/include/celero/Archive.h:
--------------------------------------------------------------------------------
1 | #ifndef H_CELERO_ARCHIVE_H
2 | #define H_CELERO_ARCHIVE_H
3 |
4 | ///
5 | /// \author John Farrier
6 | ///
7 | /// \copyright Copyright 2015 John Farrier
8 | ///
9 | /// Licensed under the Apache License, Version 2.0 (the "License");
10 | /// you may not use this file except in compliance with the License.
11 | /// You may obtain a copy of the License at
12 | ///
13 | /// http://www.apache.org/licenses/LICENSE-2.0
14 | ///
15 | /// Unless required by applicable law or agreed to in writing, software
16 | /// distributed under the License is distributed on an "AS IS" BASIS,
17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | /// See the License for the specific language governing permissions and
19 | /// limitations under the License.
20 | ///
21 |
22 | #include
23 | #include
24 | #include
25 |
26 | namespace celero
27 | {
28 | ///
29 | /// \class Archive
30 | ///
31 | /// \author John Farrier
32 | ///
33 | class CELERO_EXPORT Archive
34 | {
35 | public:
36 | ///
37 | /// Singleton
38 | ///
39 | static Archive& Instance();
40 |
41 | ///
42 | /// Specify a file name for a results output file.
43 | ///
44 | /// \param x The name of the output file in which to store Celero's results.
45 | ///
46 | void setFileName(const std::string& x);
47 |
48 | ///
49 | /// Adds or updates a result which will be saved to a results archive file.
50 | ///
51 | /// This should re-save on every new result so that the output can be monitored externally.
52 | ///
53 | void add(std::shared_ptr x);
54 |
55 | ///
56 | /// Saves all current results to a results archive file.
57 | ///
58 | /// Will overwrite all existing data and refresh with new data.
59 | ///
60 | void save();
61 |
62 | private:
63 | ///
64 | /// Default Constructor
65 | ///
66 | Archive();
67 |
68 | ///
69 | /// Non-copyable.
70 | /// Visual studio 2012 does not support "delete" here.
71 | ///
72 | Archive(Archive&){}
73 |
74 | ///
75 | /// Default Destructor
76 | ///
77 | ~Archive();
78 |
79 | ///
80 | /// Non-assignable.
81 | /// Visual studio 2012 does not support "delete" here.
82 | ///
83 | Archive& operator=(const Archive&){return *this;}
84 |
85 | ///
86 | /// \brief Pimpl Idiom
87 | ///
88 | class Impl;
89 |
90 | ///
91 | /// \brief Pimpl Idiom
92 | ///
93 | Pimpl pimpl;
94 | };
95 | }
96 |
97 | #endif
98 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/include/celero/Callbacks.h:
--------------------------------------------------------------------------------
1 | #ifndef H_CELERO_CALLBACKS_H
2 | #define H_CELERO_CALLBACKS_H
3 |
4 | ///
5 | /// \namespace celero
6 | ///
7 | /// \author John Farrier
8 | ///
9 | /// \copyright Copyright 2015 John Farrier
10 | ///
11 | /// Licensed under the Apache License, Version 2.0 (the "License");
12 | /// you may not use this file except in compliance with the License.
13 | /// You may obtain a copy of the License at
14 | ///
15 | /// http://www.apache.org/licenses/LICENSE-2.0
16 | ///
17 | /// Unless required by applicable law or agreed to in writing, software
18 | /// distributed under the License is distributed on an "AS IS" BASIS,
19 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 | /// See the License for the specific language governing permissions and
21 | /// limitations under the License.
22 | ///
23 | /// Ideas from Nick Brunn's Hayai (https://github.com/nickbruun/hayai) were used and I likely owe him a beer.
24 | ///
25 | /// Special thanks to the band "3" for providing the development soundtrack.
26 | ///
27 | /// "Iterations" refers to how many loops of the test function are measured as a time.
28 | /// For very fast code, many iterations would help amoratize measurement error.
29 | ///
30 | /// "Samples" refers to how many sets of "iterations" will be performed. Each "sample" is
31 | /// a single measurement. Set to 0 to have Celero decide how many samples are required
32 | /// for a minimally significant answer.
33 | ///
34 | /// It is highly encouraged to only run this code compiled in a "Release" mode to use all available optimizations.
35 | ///
36 |
37 | #include
38 | #include
39 |
40 | #include
41 | #include
42 |
43 | namespace celero
44 | {
45 | ///
46 | /// \brief Add a function to call when a experiment is completed.
47 | ///
48 | /// This will be called at the end of a complete experiment (benchmark + experiment results.)
49 | ///
50 | CELERO_EXPORT void AddExperimentCompleteFunction(std::function)> x);
51 |
52 | ///
53 | /// \brief Add a function to call when a experiment is completed.
54 | ///
55 | /// This will be called at the end of every benchmark or user experiment upon completion.
56 | ///
57 | CELERO_EXPORT void AddExperimentResultCompleteFunction(std::function)> x);
58 |
59 | namespace impl
60 | {
61 | void ExperimentComplete(std::shared_ptr x);
62 | void ExperimentResultComplete(std::shared_ptr x);
63 | }
64 | }
65 |
66 | #endif
67 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/include/celero/Console.h:
--------------------------------------------------------------------------------
1 | #ifndef H_CELERO_CONSOLE_H
2 | #define H_CELERO_CONSOLE_H
3 |
4 | ///
5 | /// \author John Farrier
6 | ///
7 | /// \copyright Copyright 2015 John Farrier
8 | ///
9 | /// Licensed under the Apache License, Version 2.0 (the "License");
10 | /// you may not use this file except in compliance with the License.
11 | /// You may obtain a copy of the License at
12 | ///
13 | /// http://www.apache.org/licenses/LICENSE-2.0
14 | ///
15 | /// Unless required by applicable law or agreed to in writing, software
16 | /// distributed under the License is distributed on an "AS IS" BASIS,
17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | /// See the License for the specific language governing permissions and
19 | /// limitations under the License.
20 | ///
21 |
22 | #include
23 |
24 | namespace celero
25 | {
26 | ///
27 | /// \namespace console
28 | ///
29 | /// \author John farrier
30 | ///
31 | namespace console
32 | {
33 | ///
34 | /// \enum ConsoleColor
35 | ///
36 | /// \author John farrier
37 | ///
38 | enum ConsoleColor
39 | {
40 | ConsoleColor_Default,
41 | ConsoleColor_Red,
42 | ConsoleColor_Red_Bold,
43 | ConsoleColor_Green,
44 | ConsoleColor_Green_Bold,
45 | ConsoleColor_Blue,
46 | ConsoleColor_Blue_Bold,
47 | ConsoleColor_Cyan,
48 | ConsoleColor_Cyan_Bold,
49 | ConsoleColor_Yellow,
50 | ConsoleColor_Yellow_Bold,
51 | ConsoleColor_White,
52 | ConsoleColor_White_Bold,
53 | ConsoleColor_WhiteOnRed,
54 | ConsoleColor_WhiteOnRed_Bold,
55 | ConsoleColor_Purple_Bold
56 | };
57 |
58 | ///
59 | /// Set the color of std::out on the console.
60 | ///
61 | CELERO_EXPORT void SetConsoleColor(const celero::console::ConsoleColor x);
62 | }
63 | }
64 |
65 | #endif
66 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/include/celero/Distribution.h:
--------------------------------------------------------------------------------
1 | #ifndef H_CELERO_DISTRIBUTION_H
2 | #define H_CELERO_DISTRIBUTION_H
3 |
4 | ///
5 | /// \author John Farrier
6 | ///
7 | /// \copyright Copyright 2015 John Farrier
8 | ///
9 | /// Licensed under the Apache License, Version 2.0 (the "License");
10 | /// you may not use this file except in compliance with the License.
11 | /// You may obtain a copy of the License at
12 | ///
13 | /// http://www.apache.org/licenses/LICENSE-2.0
14 | ///
15 | /// Unless required by applicable law or agreed to in writing, software
16 | /// distributed under the License is distributed on an "AS IS" BASIS,
17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | /// See the License for the specific language governing permissions and
19 | /// limitations under the License.
20 | ///
21 |
22 | #include
23 | #include
24 | #include
25 |
26 | namespace celero
27 | {
28 | ///
29 | /// Collects results from Celero for analysis of a hard-coded internal trivial measurement case.
30 | ///
31 | CELERO_EXPORT std::vector BuildDistribution(uint64_t numberOfSamples, uint64_t iterationsPerSample);
32 |
33 | ///
34 | /// Builds a .csv file to help determine Celero's measurement distribution.
35 | ///
36 | CELERO_EXPORT void RunDistribution(uint64_t iterationsPerSample);
37 | }
38 |
39 | #endif
40 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/include/celero/Executor.h:
--------------------------------------------------------------------------------
1 | #ifndef H_CELERO_EXECUTOR_H
2 | #define H_CELERO_EXECUTOR_H
3 |
4 | ///
5 | /// \author John Farrier
6 | ///
7 | /// \copyright Copyright 2015 John Farrier
8 | ///
9 | /// Licensed under the Apache License, Version 2.0 (the "License");
10 | /// you may not use this file except in compliance with the License.
11 | /// You may obtain a copy of the License at
12 | ///
13 | /// http://www.apache.org/licenses/LICENSE-2.0
14 | ///
15 | /// Unless required by applicable law or agreed to in writing, software
16 | /// distributed under the License is distributed on an "AS IS" BASIS,
17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | /// See the License for the specific language governing permissions and
19 | /// limitations under the License.
20 | ///
21 |
22 | #include
23 | #include
24 | #include
25 | #include
26 |
27 | namespace celero
28 | {
29 | namespace executor
30 | {
31 | ///
32 | /// Run all baselines and experiments registered within the final application.
33 | ///
34 | void RunAll();
35 |
36 | ///
37 | /// Run all baselines (but not experiments) registered within the final application.
38 | ///
39 | void RunAllBaselines();
40 |
41 | ///
42 | /// Run a specific benchmark's baseline.
43 | ///
44 | void RunBaseline(std::shared_ptr x);
45 |
46 | ///
47 | /// Run all experiments registered within the final application.
48 | ///
49 | void RunAllExperiments();
50 |
51 | ///
52 | /// Run all experiments within a specific benchmark.
53 | ///
54 | void RunExperiments(std::shared_ptr x);
55 |
56 | ///
57 | /// Run a specific benchmark.
58 | ///
59 | void Run(std::shared_ptr x);
60 |
61 | ///
62 | /// Run a specific experiment.
63 | ///
64 | /// If the baseline is not complete for the given experiment, it will be executed first.
65 | ///
66 | void Run(std::shared_ptr x);
67 |
68 | ///
69 | /// Run a specific benchmark with the specified name.
70 | ///
71 | void Run(const std::string& group);
72 |
73 | ///
74 | /// Run a specific benchmark with the specified name and one specific experiment within it.
75 | ///
76 | /// If the baseline is not complete for the given experiment, it will be executed first.
77 | ///
78 | void Run(const std::string& group, const std::string& experiment);
79 | }
80 | }
81 |
82 | #endif
83 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/include/celero/Export.h:
--------------------------------------------------------------------------------
1 | #ifndef H_CELERO_EXPORT_H
2 | #define H_CELERO_EXPORT_H
3 |
4 | ///
5 | /// \author John Farrier
6 | ///
7 | /// \copyright Copyright 2015 John Farrier
8 | ///
9 | /// Licensed under the Apache License, Version 2.0 (the "License");
10 | /// you may not use this file except in compliance with the License.
11 | /// You may obtain a copy of the License at
12 | ///
13 | /// http://www.apache.org/licenses/LICENSE-2.0
14 | ///
15 | /// Unless required by applicable law or agreed to in writing, software
16 | /// distributed under the License is distributed on an "AS IS" BASIS,
17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | /// See the License for the specific language governing permissions and
19 | /// limitations under the License.
20 | ///
21 |
22 | #ifdef CELERO_STATIC
23 | #define CELERO_EXPORT
24 | #define CELERO_EXPORT_C
25 | #else
26 | #ifdef WIN32
27 | #if defined CELERO_EXPORTS
28 | #define CELERO_EXPORT _declspec(dllexport)
29 | #define CELERO_EXPORT_C extern "C" _declspec(dllexport)
30 | #else
31 | #define CELERO_EXPORT _declspec(dllimport)
32 | #define CELERO_EXPORT_C extern "C" _declspec(dllimport)
33 | #endif
34 | #else
35 | #define CELERO_EXPORT
36 | #define CELERO_EXPORT_C extern "C"
37 | #endif
38 | #endif
39 |
40 | #endif
41 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/include/celero/Factory.h:
--------------------------------------------------------------------------------
1 | #ifndef H_CELERO_FACTORY_H
2 | #define H_CELERO_FACTORY_H
3 |
4 | ///
5 | /// \author John Farrier
6 | ///
7 | /// \copyright Copyright 2015 John Farrier
8 | ///
9 | /// Licensed under the Apache License, Version 2.0 (the "License");
10 | /// you may not use this file except in compliance with the License.
11 | /// You may obtain a copy of the License at
12 | ///
13 | /// http://www.apache.org/licenses/LICENSE-2.0
14 | ///
15 | /// Unless required by applicable law or agreed to in writing, software
16 | /// distributed under the License is distributed on an "AS IS" BASIS,
17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | /// See the License for the specific language governing permissions and
19 | /// limitations under the License.
20 | ///
21 |
22 | #include
23 | #include
24 | #include
25 |
26 | namespace celero
27 | {
28 | ///
29 | /// \class Factory
30 | ///
31 | /// \author John Farrier
32 | ///
33 | /// Pure Virtual Base class for benchmarks.
34 | ///
35 | class CELERO_EXPORT Factory
36 | {
37 | public:
38 | ///
39 | /// \brief Default Constructor
40 | ///
41 | Factory()
42 | {
43 | }
44 |
45 | ///
46 | /// \brief Virtual Destructor
47 | ///
48 | virtual ~Factory()
49 | {
50 | }
51 |
52 | ///
53 | /// \brief Pure virtual function.
54 | ///
55 | virtual std::shared_ptr Create() = 0;
56 | };
57 | }
58 |
59 | #endif
60 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/include/celero/FileReader.h:
--------------------------------------------------------------------------------
1 | #ifndef H_CELERO_FILEREADER_H
2 | #define H_CELERO_FILEREADER_H
3 |
4 | ///
5 | /// \author John Farrier
6 | ///
7 | /// \copyright Copyright 2015 John Farrier
8 | ///
9 | /// Licensed under the Apache License, Version 2.0 (the "License");
10 | /// you may not use this file except in compliance with the License.
11 | /// You may obtain a copy of the License at
12 | ///
13 | /// http://www.apache.org/licenses/LICENSE-2.0
14 | ///
15 | /// Unless required by applicable law or agreed to in writing, software
16 | /// distributed under the License is distributed on an "AS IS" BASIS,
17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | /// See the License for the specific language governing permissions and
19 | /// limitations under the License.
20 | ///
21 |
22 | #include
23 |
24 | namespace celero
25 | {
26 | /// \struct FileReader
27 | ///
28 | /// A helper struct to aid in reading CSV files.
29 | ///
30 | /// Classify commas as whitespace.
31 | ///
32 | struct FieldReader : std::ctype
33 | {
34 | FieldReader() : std::ctype(FieldReader::GetTable())
35 | {
36 | }
37 |
38 | static std::ctype_base::mask const* GetTable()
39 | {
40 | static std::vector rc(table_size, std::ctype_base::mask());
41 | rc[','] = std::ctype_base::space;
42 | rc['\n'] = std::ctype_base::space;
43 | rc['\r'] = std::ctype_base::space;
44 | return &rc[0];
45 | }
46 | };
47 | }
48 |
49 | #endif
50 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/include/celero/GenericFactory.h:
--------------------------------------------------------------------------------
1 | #ifndef H_CELERO_GENERICFACTORY_H
2 | #define H_CELERO_GENERICFACTORY_H
3 |
4 | ///
5 | /// \author John Farrier
6 | ///
7 | /// \copyright Copyright 2015 John Farrier
8 | ///
9 | /// Licensed under the Apache License, Version 2.0 (the "License");
10 | /// you may not use this file except in compliance with the License.
11 | /// You may obtain a copy of the License at
12 | ///
13 | /// http://www.apache.org/licenses/LICENSE-2.0
14 | ///
15 | /// Unless required by applicable law or agreed to in writing, software
16 | /// distributed under the License is distributed on an "AS IS" BASIS,
17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | /// See the License for the specific language governing permissions and
19 | /// limitations under the License.
20 | ///
21 |
22 | #include
23 | #include
24 |
25 | namespace celero
26 | {
27 | ///
28 | /// \class GenericFactory
29 | ///
30 | /// \author John farrier
31 | ///
32 | template class GenericFactory : public Factory
33 | {
34 | public:
35 | ///
36 | /// \brief Default Constructor
37 | ///
38 | GenericFactory() : Factory()
39 | {
40 | }
41 |
42 | ///
43 | /// \brief Virtual Destructor
44 | ///
45 | virtual ~GenericFactory()
46 | {
47 | }
48 |
49 | ///
50 | /// \brief Overload the pure virtual base class function.
51 | ///
52 | virtual std::shared_ptr Create()
53 | {
54 | return std::make_shared();
55 | }
56 | };
57 | }
58 |
59 | #endif
60 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/include/celero/JUnit.h:
--------------------------------------------------------------------------------
1 | #ifndef H_CELERO_JUNIT_H
2 | #define H_CELERO_JUNIT_H
3 |
4 | ///
5 | /// \author John Farrier
6 | ///
7 | /// \copyright Copyright 2015 John Farrier
8 | ///
9 | /// Licensed under the Apache License, Version 2.0 (the "License");
10 | /// you may not use this file except in compliance with the License.
11 | /// You may obtain a copy of the License at
12 | ///
13 | /// http://www.apache.org/licenses/LICENSE-2.0
14 | ///
15 | /// Unless required by applicable law or agreed to in writing, software
16 | /// distributed under the License is distributed on an "AS IS" BASIS,
17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | /// See the License for the specific language governing permissions and
19 | /// limitations under the License.
20 | ///
21 |
22 | #include
23 | #include
24 | #include
25 |
26 | namespace celero
27 | {
28 | ///
29 | /// \class JUnit
30 | ///
31 | /// \author John Farrier
32 | ///
33 | class JUnit
34 | {
35 | public:
36 | ///
37 | /// Singleton
38 | ///
39 | static JUnit& Instance();
40 |
41 | ///
42 | /// Specify a file name for a results output file.
43 | ///
44 | /// \param x The name of the output file in which to store Celero's results.
45 | ///
46 | void setFileName(const std::string& x);
47 |
48 | ///
49 | /// Add a new result to the JUnit output XML.
50 | ///
51 | /// This should re-save on every new result so that the output can be monitored externally.
52 | ///
53 | void add(std::shared_ptr x);
54 |
55 | ///
56 | ///
57 | ///
58 | void save();
59 |
60 | private:
61 | ///
62 | /// Default Constructor
63 | ///
64 | JUnit();
65 |
66 | ///
67 | /// Default Destructor
68 | ///
69 | ~JUnit();
70 |
71 | ///
72 | /// \brief Pimpl Idiom
73 | ///
74 | class Impl;
75 |
76 | ///
77 | /// \brief Pimpl Idiom
78 | ///
79 | Pimpl pimpl;
80 | };
81 | }
82 |
83 | #endif
84 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/include/celero/Pimpl.h:
--------------------------------------------------------------------------------
1 | #ifndef H_CELERO_PIMPL_H
2 | #define H_CELERO_PIMPL_H
3 |
4 | ///
5 | /// \author John Farrier
6 | ///
7 | /// \copyright Copyright 2015 John Farrier
8 | ///
9 | /// Licensed under the Apache License, Version 2.0 (the "License");
10 | /// you may not use this file except in compliance with the License.
11 | /// You may obtain a copy of the License at
12 | ///
13 | /// http://www.apache.org/licenses/LICENSE-2.0
14 | ///
15 | /// Unless required by applicable law or agreed to in writing, software
16 | /// distributed under the License is distributed on an "AS IS" BASIS,
17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | /// See the License for the specific language governing permissions and
19 | /// limitations under the License.
20 | ///
21 |
22 | #include
23 | #include
24 |
25 | namespace celero
26 | {
27 | ///
28 | /// \class Pimpl
29 | ///
30 | /// \author Herb Sutter
31 | /// \author John Farrier
32 | ///
33 | /// Classes using this must overload the assignment operator.
34 | /// Original code by Herb Sutter. Adapted for more primitive compilers by John Farrier.
35 | ///
36 | template class Pimpl
37 | {
38 | public:
39 | Pimpl();
40 | //template Pimpl( Args&& ... );
41 | template Pimpl(Arg1&&);
42 | template Pimpl(Arg1&&, Arg2&&);
43 | template Pimpl(Arg1&&, Arg2&&, Arg3&&);
44 | template Pimpl(Arg1&&, Arg2&&, Arg3&&, Arg4&&);
45 | template Pimpl(Arg1&&, Arg2&&, Arg3&&, Arg4&&, Arg5&&);
46 | template Pimpl(Arg1&&, Arg2&&, Arg3&&, Arg4&&, Arg5&&, Arg6&&);
47 | ~Pimpl();
48 |
49 | T* operator->();
50 | const T* operator->() const;
51 | T& operator*();
52 |
53 | private:
54 | std::unique_ptr _pimpl;
55 | };
56 | }
57 |
58 | #endif
59 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/include/celero/Print.h:
--------------------------------------------------------------------------------
1 | #ifndef H_CELERO_PRINT_H
2 | #define H_CELERO_PRINT_H
3 |
4 | ///
5 | /// \author John Farrier
6 | ///
7 | /// \copyright Copyright 2015 John Farrier
8 | ///
9 | /// Licensed under the Apache License, Version 2.0 (the "License");
10 | /// you may not use this file except in compliance with the License.
11 | /// You may obtain a copy of the License at
12 | ///
13 | /// http://www.apache.org/licenses/LICENSE-2.0
14 | ///
15 | /// Unless required by applicable law or agreed to in writing, software
16 | /// distributed under the License is distributed on an "AS IS" BASIS,
17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | /// See the License for the specific language governing permissions and
19 | /// limitations under the License.
20 | ///
21 |
22 | #include
23 | #include
24 | #include
25 |
26 | namespace celero
27 | {
28 | ///
29 | /// \namespace print
30 | ///
31 | /// \author John farrier
32 | ///
33 | namespace print
34 | {
35 | //void StageBanner(const std::string& x);
36 | //void GreenBar(const std::string& x);
37 | //void Run(const std::string& x);
38 | //void Status(const std::string& x);
39 | //void Failure(const std::string& x);
40 | //void Run(std::shared_ptr x);
41 | //void Done(std::shared_ptr x);
42 | //void Baseline(std::shared_ptr x);
43 | //void SummaryTest(const std::string& x);
44 | //void Summary(std::shared_ptr x);
45 |
46 | void Console(const std::string& x);
47 | void TableBanner();
48 | void TableRowHeader(std::shared_ptr x);
49 | void TableResult(std::shared_ptr x);
50 | }
51 | }
52 |
53 | #endif
54 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/include/celero/ResultTable.h:
--------------------------------------------------------------------------------
1 | #ifndef H_CELERO_RESULTTABLE_H
2 | #define H_CELERO_RESULTTABLE_H
3 |
4 | ///
5 | /// \author John Farrier
6 | ///
7 | /// \copyright Copyright 2015 John Farrier
8 | ///
9 | /// Licensed under the Apache License, Version 2.0 (the "License");
10 | /// you may not use this file except in compliance with the License.
11 | /// You may obtain a copy of the License at
12 | ///
13 | /// http://www.apache.org/licenses/LICENSE-2.0
14 | ///
15 | /// Unless required by applicable law or agreed to in writing, software
16 | /// distributed under the License is distributed on an "AS IS" BASIS,
17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | /// See the License for the specific language governing permissions and
19 | /// limitations under the License.
20 | ///
21 |
22 | #include
23 | #include
24 | #include
25 |
26 | namespace celero
27 | {
28 | ///
29 | /// \class ResultTable
30 | ///
31 | /// \author John Farrier
32 | ///
33 | class ResultTable
34 | {
35 | public:
36 | ///
37 | /// Singleton
38 | ///
39 | static ResultTable& Instance();
40 |
41 | ///
42 | /// Specify a file name for a results output file.
43 | ///
44 | /// \param x The name of the output file in which to store Celero's results.
45 | ///
46 | void setFileName(const std::string& x);
47 |
48 | ///
49 | /// Add a new result to the result table.
50 | ///
51 | /// This should re-save on every new result so that the output can be monitored externally.
52 | ///
53 | void add(std::shared_ptr x);
54 |
55 | ///
56 | ///
57 | ///
58 | void save();
59 |
60 | private:
61 | ///
62 | /// Default Constructor
63 | ///
64 | ResultTable();
65 |
66 | ///
67 | /// Default Destructor
68 | ///
69 | ~ResultTable();
70 |
71 | ///
72 | /// \brief Pimpl Idiom
73 | ///
74 | class Impl;
75 |
76 | ///
77 | /// \brief Pimpl Idiom
78 | ///
79 | Pimpl pimpl;
80 | };
81 | }
82 |
83 | #endif
84 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/include/celero/Statistics.h:
--------------------------------------------------------------------------------
1 | #ifndef H_CELERO_STATISTICS_H
2 | #define H_CELERO_STATISTICS_H
3 |
4 | ///
5 | /// \author John Farrier
6 | ///
7 | /// \copyright Copyright 2015 John Farrier
8 | ///
9 | /// Licensed under the Apache License, Version 2.0 (the "License");
10 | /// you may not use this file except in compliance with the License.
11 | /// You may obtain a copy of the License at
12 | ///
13 | /// http://www.apache.org/licenses/LICENSE-2.0
14 | ///
15 | /// Unless required by applicable law or agreed to in writing, software
16 | /// distributed under the License is distributed on an "AS IS" BASIS,
17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | /// See the License for the specific language governing permissions and
19 | /// limitations under the License.
20 | ///
21 |
22 | #include
23 | #include
24 |
25 | namespace celero
26 | {
27 | ///
28 | /// \class Statistics
29 | ///
30 | /// \author John Farrier
31 | ///
32 | /// Sources:
33 | /// http://www.johndcook.com/skewness_kurtosis.html
34 | /// http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
35 | /// http://prod.sandia.gov/techlib/access-control.cgi/2008/086212.pdf
36 | /// http://en.wikipedia.org/wiki/Kurtosis
37 | ///
38 | class Statistics
39 | {
40 | public:
41 | ///
42 | /// \brief Default constructor
43 | ///
44 | Statistics();
45 |
46 | Statistics(const Statistics& other);
47 |
48 | ~Statistics();
49 |
50 | Statistics operator+(const Statistics& other);
51 |
52 | Statistics& operator+=(const Statistics& other);
53 |
54 | Statistics& operator=(const Statistics& other);
55 |
56 | ///
57 | /// Resets all accumulated statistics.
58 | ///
59 | void reset();
60 |
61 | ///
62 | /// Adds a statistical sample.
63 | ///
64 | void addSample(uint64_t x);
65 |
66 | size_t getSize() const;
67 |
68 | double getMean() const;
69 |
70 | double getVariance() const;
71 |
72 | double getStandardDeviation() const;
73 |
74 | double getSkewness() const;
75 |
76 | double getKurtosis() const;
77 |
78 | ///
79 | /// Computed as (mean - hypothesis)/standard_deviation
80 | ///
81 | /// Here, the hypothesis is our minimum value.
82 | ///
83 | double getZScore() const;
84 |
85 | uint64_t getMin() const;
86 |
87 | uint64_t getMax() const;
88 |
89 | private:
90 | class Impl;
91 | Pimpl pimpl;
92 | };
93 | }
94 |
95 | #endif
96 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/include/celero/TestVector.h:
--------------------------------------------------------------------------------
1 | #ifndef H_CELERO_TESTVECTOR_H
2 | #define H_CELERO_TESTVECTOR_H
3 |
4 | ///
5 | /// \author John Farrier
6 | ///
7 | /// \copyright Copyright 2015 John Farrier
8 | ///
9 | /// Licensed under the Apache License, Version 2.0 (the "License");
10 | /// you may not use this file except in compliance with the License.
11 | /// You may obtain a copy of the License at
12 | ///
13 | /// http://www.apache.org/licenses/LICENSE-2.0
14 | ///
15 | /// Unless required by applicable law or agreed to in writing, software
16 | /// distributed under the License is distributed on an "AS IS" BASIS,
17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | /// See the License for the specific language governing permissions and
19 | /// limitations under the License.
20 | ///
21 |
22 | #include
23 | #include
24 | #include
25 | #include
26 |
27 | namespace celero
28 | {
29 | ///
30 | /// \class TestVector
31 | ///
32 | /// \author John Farrier
33 | ///
34 | class TestVector
35 | {
36 | public:
37 | static TestVector& Instance();
38 |
39 | void push_back(std::shared_ptr x);
40 |
41 | size_t size() const;
42 |
43 | std::shared_ptr operator[](size_t x);
44 | std::shared_ptr operator[](const std::string& x);
45 |
46 | private:
47 | ///
48 | /// Default Constructor
49 | ///
50 | TestVector();
51 |
52 | ///
53 | /// \brief Pimpl Idiom
54 | ///
55 | class Impl;
56 |
57 | ///
58 | /// \brief Pimpl Idiom
59 | ///
60 | Pimpl pimpl;
61 | };
62 | }
63 |
64 | #endif
65 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/include/celero/ThreadLocal.h:
--------------------------------------------------------------------------------
1 | #ifndef H_CELERO_THREADLOCAL_H
2 | #define H_CELERO_THREADLOCAL_H
3 |
4 | ///
5 | /// \author Ivan Shynkarenka
6 | ///
7 | /// \copyright Copyright 2015 John Farrier
8 | ///
9 | /// Licensed under the Apache License, Version 2.0 (the "License");
10 | /// you may not use this file except in compliance with the License.
11 | /// You may obtain a copy of the License at
12 | ///
13 | /// http://www.apache.org/licenses/LICENSE-2.0
14 | ///
15 | /// Unless required by applicable law or agreed to in writing, software
16 | /// distributed under the License is distributed on an "AS IS" BASIS,
17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | /// See the License for the specific language governing permissions and
19 | /// limitations under the License.
20 | ///
21 |
22 | #ifndef thread_local
23 |
24 | # if __STDC_VERSION__ >= 201112 && !defined __STDC_NO_THREADS__
25 | # define thread_local _Thread_local
26 | # elif defined _WIN32 && ( \
27 | defined _MSC_VER || \
28 | defined __ICL || \
29 | defined __DMC__ || \
30 | defined __BORLANDC__ )
31 | # define thread_local __declspec(thread)
32 | /* note that ICC (linux) and Clang are covered by __GNUC__ */
33 | # elif defined __GNUC__ || \
34 | defined __SUNPRO_C || \
35 | defined __xlC__
36 | # define thread_local __thread
37 | # else
38 | # error "Cannot define thread_local"
39 | # endif
40 | #endif
41 |
42 | #endif
43 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/include/celero/ThreadTestFixture.h:
--------------------------------------------------------------------------------
1 | #ifndef H_CELERO_THREADTESTFIXTURE_H
2 | #define H_CELERO_THREADTESTFIXTURE_H
3 |
4 | ///
5 | /// \author Ivan Shynkarenka
6 | ///
7 | /// \copyright Copyright 2015 John Farrier
8 | ///
9 | /// Licensed under the Apache License, Version 2.0 (the "License");
10 | /// you may not use this file except in compliance with the License.
11 | /// You may obtain a copy of the License at
12 | ///
13 | /// http://www.apache.org/licenses/LICENSE-2.0
14 | ///
15 | /// Unless required by applicable law or agreed to in writing, software
16 | /// distributed under the License is distributed on an "AS IS" BASIS,
17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | /// See the License for the specific language governing permissions and
19 | /// limitations under the License.
20 | ///
21 |
22 | #include
23 | #include
24 |
25 | namespace celero
26 | {
27 | class Benchmark;
28 |
29 | ///
30 | /// \class ThreadTestFixture
31 | ///
32 | /// \author Ivan Shynkarenka
33 | ///
34 | class CELERO_EXPORT ThreadTestFixture : public TestFixture
35 | {
36 | public:
37 | ///
38 | /// Default Constructor.
39 | ///
40 | ThreadTestFixture();
41 |
42 | ///
43 | /// Virtual destructor for inheritance.
44 | ///
45 | virtual ~ThreadTestFixture();
46 |
47 | ///
48 | /// Start threads before benchmark execution.
49 | ///
50 | /// \param threads Count of working threads to start.
51 | /// \param calls The total number of times to loop over the UserBenchmark function.
52 | ///
53 | virtual void startThreads(uint64_t threads, uint64_t calls);
54 |
55 | ///
56 | /// Called after test completion to stop threads.
57 | ///
58 | virtual void stopThreads();
59 |
60 | ///
61 | /// \param threads The number of working threads.
62 | /// \param calls The total number of times to loop over the UserBenchmark function.
63 | /// \param experimentValue The experiment value to pass in setUp function.
64 | ///
65 | /// \return Returns a pair of the number of microseconds the run took.
66 | ///
67 | uint64_t run(uint64_t threads, uint64_t calls, int64_t experimentValue) override;
68 |
69 | ///
70 | /// Get the current call number starting from 1.
71 | ///
72 | uint64_t getCallId() const;
73 |
74 | ///
75 | /// Get the current thread Id starting from 1.
76 | ///
77 | uint64_t getThreadId() const;
78 |
79 | private:
80 | class Impl;
81 | Pimpl pimpl;
82 | };
83 | }
84 |
85 | #endif
86 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/include/celero/Timer.h:
--------------------------------------------------------------------------------
1 | #ifndef H_CELERO_TIMER_H
2 | #define H_CELERO_TIMER_H
3 |
4 | ///
5 | /// \author John Farrier
6 | ///
7 | /// \copyright Copyright 2015 John Farrier
8 | ///
9 | /// Licensed under the Apache License, Version 2.0 (the "License");
10 | /// you may not use this file except in compliance with the License.
11 | /// You may obtain a copy of the License at
12 | ///
13 | /// http://www.apache.org/licenses/LICENSE-2.0
14 | ///
15 | /// Unless required by applicable law or agreed to in writing, software
16 | /// distributed under the License is distributed on an "AS IS" BASIS,
17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | /// See the License for the specific language governing permissions and
19 | /// limitations under the License.
20 | ///
21 |
22 | #include
23 |
24 | namespace celero
25 | {
26 | ///
27 | /// \namespace timer
28 | ///
29 | /// \author John Farrier
30 | ///
31 | /// \brief Provide basic cross-platform timing functions to measure code performance speed.
32 | ///
33 | namespace timer
34 | {
35 | ///
36 | /// \brief Retrieves the current time.
37 | ///
38 | /// \author John Farrier
39 | ///
40 | /// \return The time, in ticks.
41 | ///
42 | uint64_t GetSystemTime();
43 |
44 | ///
45 | /// \brief Converts the gathered system time into seconds.
46 | ///
47 | /// This assumes "x" is a delta and relatively small (easily fits inside of a double).
48 | ///
49 | /// \author John Farrier
50 | ///
51 | /// \param x The time, in ticks.
52 | ///
53 | /// \return The time, in seconds.
54 | ///
55 | double ConvertSystemTime(const uint64_t x);
56 |
57 | ///
58 | /// On Windows, this caches the frequency of the high performance clock.
59 | ///
60 | void CachePerformanceFrequency();
61 | }
62 | }
63 |
64 | #endif
65 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/src/Callbacks.cpp:
--------------------------------------------------------------------------------
1 | ///
2 | /// \author John Farrier
3 | ///
4 | /// \copyright Copyright 2015 John Farrier
5 | ///
6 | /// Licensed under the Apache License, Version 2.0 (the "License");
7 | /// you may not use this file except in compliance with the License.
8 | /// You may obtain a copy of the License at
9 | ///
10 | /// http://www.apache.org/licenses/LICENSE-2.0
11 | ///
12 | /// Unless required by applicable law or agreed to in writing, software
13 | /// distributed under the License is distributed on an "AS IS" BASIS,
14 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | /// See the License for the specific language governing permissions and
16 | /// limitations under the License.
17 | ///
18 |
19 | #include
20 |
21 | #include
22 | #include
23 |
24 | using namespace celero;
25 |
26 | std::vector)>> ExperimentFunctions;
27 | std::vector)>> ExperimentResultFunctions;
28 |
29 | void celero::impl::ExperimentComplete(std::shared_ptr x)
30 | {
31 | for(auto& i : ExperimentFunctions)
32 | {
33 | i(x);
34 | }
35 | }
36 |
37 | void celero::impl::ExperimentResultComplete(std::shared_ptr x)
38 | {
39 | for(auto& i : ExperimentResultFunctions)
40 | {
41 | i(x);
42 | }
43 | }
44 |
45 | void celero::AddExperimentCompleteFunction(std::function)> x)
46 | {
47 | ExperimentFunctions.push_back(x);
48 | }
49 |
50 | void celero::AddExperimentResultCompleteFunction(std::function)> x)
51 | {
52 | ExperimentResultFunctions.push_back(x);
53 | }
54 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/src/TestFixture.cpp:
--------------------------------------------------------------------------------
1 | ///
2 | /// \author John Farrier
3 | ///
4 | /// \copyright Copyright 2015 John Farrier
5 | ///
6 | /// Licensed under the Apache License, Version 2.0 (the "License");
7 | /// you may not use this file except in compliance with the License.
8 | /// You may obtain a copy of the License at
9 | ///
10 | /// http://www.apache.org/licenses/LICENSE-2.0
11 | ///
12 | /// Unless required by applicable law or agreed to in writing, software
13 | /// distributed under the License is distributed on an "AS IS" BASIS,
14 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | /// See the License for the specific language governing permissions and
16 | /// limitations under the License.
17 | ///
18 |
19 | #include
20 |
21 | #include
22 | #include
23 |
24 | #include
25 |
26 | using namespace celero;
27 |
28 | TestFixture::TestFixture()
29 | {
30 | }
31 |
32 | TestFixture::~TestFixture()
33 | {
34 | }
35 |
36 | void TestFixture::onExperimentStart(int64_t)
37 | {
38 | }
39 |
40 | void TestFixture::onExperimentEnd()
41 | {
42 | }
43 |
44 | void TestFixture::setUp(int64_t)
45 | {
46 | }
47 |
48 | void TestFixture::tearDown()
49 | {
50 | }
51 |
52 | uint64_t TestFixture::run(const uint64_t, const uint64_t iterations, int64_t experimentValue)
53 | {
54 | if(this->HardCodedMeasurement() == 0)
55 | {
56 | // Set up the testing fixture.
57 | this->setUp(experimentValue);
58 |
59 | // Run the test body for each iterations.
60 | auto iterationCounter = iterations;
61 |
62 | // Get the starting time.
63 | const auto startTime = celero::timer::GetSystemTime();
64 |
65 | this->onExperimentStart(experimentValue);
66 |
67 | // Count down to zero
68 | while(iterationCounter--)
69 | {
70 | this->UserBenchmark();
71 | }
72 |
73 | this->onExperimentEnd();
74 |
75 | const auto endTime = celero::timer::GetSystemTime();
76 |
77 | // Tear down the testing fixture.
78 | this->tearDown();
79 |
80 | // Return the duration in microseconds for the given problem size.
81 | return (endTime - startTime);
82 | }
83 |
84 | return this->HardCodedMeasurement();
85 | }
86 |
87 | void TestFixture::UserBenchmark()
88 | {
89 | }
90 |
91 | uint64_t TestFixture::HardCodedMeasurement() const
92 | {
93 | return uint64_t(0);
94 | }
95 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/src/TestVector.cpp:
--------------------------------------------------------------------------------
1 | ///
2 | /// \author John Farrier
3 | ///
4 | /// \copyright Copyright 2015 John Farrier
5 | ///
6 | /// Licensed under the Apache License, Version 2.0 (the "License");
7 | /// you may not use this file except in compliance with the License.
8 | /// You may obtain a copy of the License at
9 | ///
10 | /// http://www.apache.org/licenses/LICENSE-2.0
11 | ///
12 | /// Unless required by applicable law or agreed to in writing, software
13 | /// distributed under the License is distributed on an "AS IS" BASIS,
14 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | /// See the License for the specific language governing permissions and
16 | /// limitations under the License.
17 | ///
18 |
19 | #include
20 | #include
21 | #include
22 |
23 | #include
24 | #include
25 | #include
26 |
27 | using namespace celero;
28 |
29 | ///
30 | /// \class Impl
31 | ///
32 | class celero::TestVector::Impl
33 | {
34 | public:
35 | Impl() :
36 | testVectorMutex(),
37 | testVector()
38 | {
39 | }
40 |
41 | mutable std::mutex testVectorMutex;
42 | std::vector> testVector;
43 | };
44 |
45 | TestVector::TestVector() : pimpl()
46 | {
47 | }
48 |
49 | TestVector& TestVector::Instance()
50 | {
51 | static TestVector singleton;
52 | return singleton;
53 | }
54 |
55 | void TestVector::push_back(std::shared_ptr x)
56 | {
57 | std::lock_guard mutexLock(this->pimpl->testVectorMutex);
58 | this->pimpl->testVector.push_back(x);
59 | }
60 |
61 | size_t TestVector::size() const
62 | {
63 | std::lock_guard mutexLock(this->pimpl->testVectorMutex);
64 | return this->pimpl->testVector.size();
65 | }
66 |
67 | std::shared_ptr TestVector::operator[](size_t x)
68 | {
69 | std::lock_guard mutexLock(this->pimpl->testVectorMutex);
70 | return this->pimpl->testVector[x];
71 | }
72 |
73 | std::shared_ptr TestVector::operator[](const std::string& x)
74 | {
75 | std::lock_guard mutexLock(this->pimpl->testVectorMutex);
76 |
77 | const auto found = std::find_if(std::begin(this->pimpl->testVector), std::end(this->pimpl->testVector),
78 | [x](std::shared_ptr const& bmark)->bool
79 | {
80 | return (bmark->getName() == x);
81 | });
82 |
83 | if(found != std::end(this->pimpl->testVector))
84 | {
85 | return *found;
86 | }
87 |
88 | return nullptr;
89 | }
90 |
--------------------------------------------------------------------------------
/celeroTest/Celero-master/src/Timer.cpp:
--------------------------------------------------------------------------------
1 | ///
2 | /// \author John Farrier
3 | ///
4 | /// \copyright Copyright 2015 John Farrier
5 | ///
6 | /// Licensed under the Apache License, Version 2.0 (the "License");
7 | /// you may not use this file except in compliance with the License.
8 | /// You may obtain a copy of the License at
9 | ///
10 | /// http://www.apache.org/licenses/LICENSE-2.0
11 | ///
12 | /// Unless required by applicable law or agreed to in writing, software
13 | /// distributed under the License is distributed on an "AS IS" BASIS,
14 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | /// See the License for the specific language governing permissions and
16 | /// limitations under the License.
17 | ///
18 |
19 | #include
20 | #include
21 |
22 | #ifdef WIN32
23 | #include
24 | LARGE_INTEGER QPCFrequency;
25 | #else
26 | #include
27 | #endif
28 |
29 | #include
30 |
31 | uint64_t celero::timer::GetSystemTime()
32 | {
33 | #ifdef WIN32
34 | LARGE_INTEGER timeStorage;
35 | QueryPerformanceCounter(&timeStorage);
36 | return static_cast(timeStorage.QuadPart * 1000000)/static_cast(QPCFrequency.QuadPart);
37 | #else
38 | auto timePoint = std::chrono::high_resolution_clock::now();
39 | return std::chrono::duration_cast(timePoint.time_since_epoch()).count();
40 | #endif
41 | }
42 |
43 | double celero::timer::ConvertSystemTime(uint64_t x)
44 | {
45 | return x * 1.0e-6;
46 | }
47 |
48 | void celero::timer::CachePerformanceFrequency()
49 | {
50 | std::cout << "Timer resolution: ";
51 |
52 | #ifdef WIN32
53 | QueryPerformanceFrequency(&QPCFrequency);
54 | auto precision = ((1.0/static_cast(QPCFrequency.QuadPart)) * 1000000.0);
55 | #else
56 | auto precision = (static_cast(std::chrono::high_resolution_clock::period::num) /
57 | static_cast(std::chrono::high_resolution_clock::period::den)) * 1000000.0;
58 | #endif
59 |
60 | std::cout << std::to_string(precision) << " us\n";
61 | }
62 |
--------------------------------------------------------------------------------
/celeroTest/Release/celeroTest.log:
--------------------------------------------------------------------------------
1 | C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(392,5): warning MSB8028: The intermediate directory (Release\) contains files shared from another project (celeroCompressBools.vcxproj, celeroParticles.vcxproj). This can lead to incorrect clean and rebuild behavior.
2 | celeroTest.cpp
3 | celeroTest.cpp : fatal error C1041: cannot open program database 'D:\github\benchmarkLibsTest\celeroTest\Release\vc140.pdb'; if multiple CL.EXE write to the same .PDB file, please use /FS
4 |
--------------------------------------------------------------------------------
/celeroTest/celeroParticles.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/celeroTest/celeroTest.cpp:
--------------------------------------------------------------------------------
1 | #include "celero\Celero.h"
2 | #include "../commonTest.h"
3 |
4 | CELERO_MAIN;
5 |
6 | // Run an automatic baseline.
7 | // Celero will help make sure enough samples are taken to get a reasonable measurement
8 | BASELINE(IntToStringTest, Baseline10, 0, 100)
9 | {
10 | celero::DoNotOptimizeAway(IntToStringConversionTest(TEST_NUM_COUNT10));
11 | }
12 |
13 | BENCHMARK(IntToStringTest, Baseline1000, 0, 100)
14 | {
15 | celero::DoNotOptimizeAway(IntToStringConversionTest(TEST_NUM_COUNT1000));
16 | }
17 |
18 | BASELINE(DoubleToStringTest, Baseline10, 10, 100)
19 | {
20 | celero::DoNotOptimizeAway(DoubleToStringConversionTest(TEST_NUM_COUNT10));
21 | }
22 |
23 | BENCHMARK(DoubleToStringTest, Baseline1000, 10, 100)
24 | {
25 | celero::DoNotOptimizeAway(DoubleToStringConversionTest(TEST_NUM_COUNT1000));
26 | }
27 |
--------------------------------------------------------------------------------
/celeroTest/celeroTest.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/celeroTest/celeroTest.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/commonTest.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 | #include
6 |
7 | #define TEST_NUM_COUNT10 10
8 | #define TEST_NUM_COUNT100 100
9 | #define TEST_NUM_COUNT1000 1000
10 |
11 | auto IntToStringConversionTest(int count)
12 | {
13 | std::vector inputNumbers(count);
14 | std::vector outNumbers;
15 |
16 | std::iota(std::begin(inputNumbers), std::end(inputNumbers), 0);
17 | for (auto &num : inputNumbers)
18 | outNumbers.push_back(std::to_string(num));
19 |
20 | return outNumbers;
21 | }
22 |
23 | auto DoubleToStringConversionTest(int count)
24 | {
25 | std::vector inputNumbers(count);
26 | std::vector outNumbers;
27 |
28 | std::iota(std::begin(inputNumbers), std::end(inputNumbers), 0.12345);
29 | for (auto &num : inputNumbers)
30 | outNumbers.push_back(std::to_string(num));
31 |
32 | return outNumbers;
33 | }
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/.gitignore:
--------------------------------------------------------------------------------
1 | *.a
2 | *.so
3 | *.so.?*
4 | *.dll
5 | *.exe
6 | *.dylib
7 | *.cmake
8 | !/cmake/*.cmake
9 | *~
10 | *.pyc
11 | __pycache__
12 |
13 | # lcov
14 | *.lcov
15 | /lcov
16 |
17 | # cmake files.
18 | /Testing
19 | CMakeCache.txt
20 | CMakeFiles/
21 | cmake_install.cmake
22 |
23 | # makefiles.
24 | Makefile
25 |
26 | # in-source build.
27 | bin/
28 | lib/
29 | /test/*_test
30 |
31 | # exuberant ctags.
32 | tags
33 |
34 | # YouCompleteMe configuration.
35 | .ycm_extra_conf.pyc
36 |
37 | # ninja generated files.
38 | .ninja_deps
39 | .ninja_log
40 | build.ninja
41 | install_manifest.txt
42 | rules.ninja
43 |
44 | # out-of-source build top-level folders.
45 | build/
46 | _build/
47 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/.travis-setup.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Before install
4 |
5 | sudo add-apt-repository -y ppa:kalakris/cmake
6 | if [ "$STD" = "c++11" ]; then
7 | sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
8 | if [ "$CXX" = "clang++" ]; then
9 | wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
10 | sudo add-apt-repository -y "deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.6 main"
11 | fi
12 | fi
13 | sudo apt-get update -qq
14 |
15 | # Install
16 | sudo apt-get install -qq cmake
17 | if [ "$STD" = "c++11" ] && [ "$CXX" = "g++" ]; then
18 | sudo apt-get install -qq gcc-4.8 g++-4.8
19 | sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 90
20 | sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90
21 | elif [ "$CXX" = "clang++" ]; then
22 | sudo apt-get install -qq clang-3.6
23 | sudo update-alternatives --install /usr/local/bin/clang clang /usr/bin/clang-3.6 90
24 | sudo update-alternatives --install /usr/local/bin/clang++ clang++ /usr/bin/clang++-3.6 90
25 | export PATH=/usr/local/bin:$PATH
26 | fi
27 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/.travis.yml:
--------------------------------------------------------------------------------
1 | language: cpp
2 |
3 | # NOTE: The COMPILER variable is unused. It simply makes the display on
4 | # travis-ci.org more readable.
5 | matrix:
6 | include:
7 | - compiler: gcc
8 | env: COMPILER=g++-4.6 STD=c++0x BUILD_TYPE=Coverage
9 | - compiler: gcc
10 | env: COMPILER=g++-4.6 STD=c++0x BUILD_TYPE=Debug
11 | - compiler: gcc
12 | env: COMPILER=g++-4.6 STD=c++0x BUILD_TYPE=Release
13 | - compiler: gcc
14 | env: COMPILER=g++-4.8 STD=c++11 BUILD_TYPE=Debug
15 | - compiler: gcc
16 | env: COMPILER=g++-4.8 STD=c++11 BUILD_TYPE=Release
17 | - compiler: clang
18 | env: COMPILER=clang++-3.6 STD=c++11 BUILD_TYPE=Debug
19 | - compiler: clang
20 | env: COMPILER=clang++-3.6 STD=c++11 BUILD_TYPE=Release
21 |
22 | before_script:
23 | - source .travis-setup.sh
24 | - mkdir build && cd build
25 |
26 | install:
27 | - if [ "${BUILD_TYPE}" == "Coverage" -a "${TRAVIS_OS_NAME}" == "linux" ]; then
28 | PATH=~/.local/bin:${PATH};
29 | pip install --user --upgrade pip;
30 | pip install --user cpp-coveralls;
31 | fi
32 |
33 | script:
34 | - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_CXX_FLAGS="-std=${STD}"
35 | - make
36 | - make CTEST_OUTPUT_ON_FAILURE=1 test
37 |
38 | after_success:
39 | - if [ "${BUILD_TYPE}" == "Coverage" -a "${TRAVIS_OS_NAME}" == "linux" ]; then
40 | coveralls --include src --include include --gcov-options '\-lp' --root .. --build-root .;
41 | fi
42 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/ALL_BUILD.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/AUTHORS:
--------------------------------------------------------------------------------
1 | # This is the official list of benchmark authors for copyright purposes.
2 | # This file is distinct from the CONTRIBUTORS files.
3 | # See the latter for an explanation.
4 | #
5 | # Names should be added to this file as:
6 | # Name or Organization
7 | # The email address is not required for organizations.
8 | #
9 | # Please keep the list sorted.
10 |
11 | Arne Beer
12 | Christopher Seymour
13 | David Coeurjolly
14 | Dominic Hamon
15 | Eugene Zhuk
16 | Evgeny Safronov
17 | Felix Homann
18 | Google Inc.
19 | JianXiong Zhou
20 | Jussi Knuuttila
21 | Kaito Udagawa
22 | Lei Xu
23 | Matt Clarkson
24 | Oleksandr Sochka
25 | Paul Redmond
26 | Radoslav Yovchev
27 | Shuo Chen
28 | Yusuke Suzuki
29 | Dirac Research
30 | Zbigniew Skowron
31 | Dominik Czarnota
32 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/CONTRIBUTORS:
--------------------------------------------------------------------------------
1 | # People who have agreed to one of the CLAs and can contribute patches.
2 | # The AUTHORS file lists the copyright holders; this file
3 | # lists people. For example, Google employees are listed here
4 | # but not in AUTHORS, because Google holds the copyright.
5 | #
6 | # Names should be added to this file only after verifying that
7 | # the individual or the individual's organization has agreed to
8 | # the appropriate Contributor License Agreement, found here:
9 | #
10 | # https://developers.google.com/open-source/cla/individual
11 | # https://developers.google.com/open-source/cla/corporate
12 | #
13 | # The agreement for individuals can be filled out on the web.
14 | #
15 | # When adding J Random Contributor's name to this file,
16 | # either J's name or J's organization's name should be
17 | # added to the AUTHORS file, depending on whether the
18 | # individual or corporate CLA was used.
19 | #
20 | # Names should be added to this file as:
21 | # Name
22 | #
23 | # Please keep the list sorted.
24 |
25 | Arne Beer
26 | Chris Kennelly
27 | Christopher Seymour
28 | David Coeurjolly
29 | Dominic Hamon
30 | Eugene Zhuk
31 | Evgeny Safronov
32 | Felix Homann
33 | JianXiong Zhou
34 | Jussi Knuuttila
35 | Kaito Udagawa
36 | Kai Wolf
37 | Lei Xu
38 | Matt Clarkson
39 | Oleksandr Sochka
40 | Pascal Leroy
41 | Paul Redmond
42 | Pierre Phaneuf
43 | Radoslav Yovchev
44 | Shuo Chen
45 | Yusuke Suzuki
46 | Tobias Ulvgård
47 | Zbigniew Skowron
48 | Dominik Czarnota
49 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/INSTALL.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CMake Rules
6 |
7 |
8 |
9 |
10 | {204202EE-7A2D-3C35-88CF-0AE2C34270F4}
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/RUN_TESTS.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CMake Rules
6 |
7 |
8 |
9 |
10 | {204202EE-7A2D-3C35-88CF-0AE2C34270F4}
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/Win32/MinSizeRel/ZERO_CHECK/ZERO_CHECK.tlog/ZERO_CHECK.lastbuildstate:
--------------------------------------------------------------------------------
1 | #TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.10586.0
2 | MinSizeRel|Win32|C:\Users\fen\Downloads\benchmark-master(1)\benchmark-master\|
3 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/Win32/MinSizeRel/ZERO_CHECK/ZERO_CHECK.tlog/custombuild.command.1.tlog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fenbf/benchmarkLibsTest/35cc3c702a929dd9156e10a62e4a15682a1b5c97/googleBenchmarkTest/benchmark-master32/Win32/MinSizeRel/ZERO_CHECK/ZERO_CHECK.tlog/custombuild.command.1.tlog
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/Win32/MinSizeRel/ZERO_CHECK/ZERO_CHECK.tlog/custombuild.read.1.tlog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fenbf/benchmarkLibsTest/35cc3c702a929dd9156e10a62e4a15682a1b5c97/googleBenchmarkTest/benchmark-master32/Win32/MinSizeRel/ZERO_CHECK/ZERO_CHECK.tlog/custombuild.read.1.tlog
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/Win32/MinSizeRel/ZERO_CHECK/ZERO_CHECK.tlog/custombuild.write.1.tlog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fenbf/benchmarkLibsTest/35cc3c702a929dd9156e10a62e4a15682a1b5c97/googleBenchmarkTest/benchmark-master32/Win32/MinSizeRel/ZERO_CHECK/ZERO_CHECK.tlog/custombuild.write.1.tlog
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/ZERO_CHECK.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CMake Rules
6 |
7 |
8 |
9 |
10 | {204202EE-7A2D-3C35-88CF-0AE2C34270F4}
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/cmake/AddCXXCompilerFlag.cmake:
--------------------------------------------------------------------------------
1 | # - Adds a compiler flag if it is supported by the compiler
2 | #
3 | # This function checks that the supplied compiler flag is supported and then
4 | # adds it to the corresponding compiler flags
5 | #
6 | # add_cxx_compiler_flag( [])
7 | #
8 | # - Example
9 | #
10 | # include(AddCXXCompilerFlag)
11 | # add_cxx_compiler_flag(-Wall)
12 | # add_cxx_compiler_flag(-no-strict-aliasing RELEASE)
13 | # Requires CMake 2.6+
14 |
15 | if(__add_cxx_compiler_flag)
16 | return()
17 | endif()
18 | set(__add_cxx_compiler_flag INCLUDED)
19 |
20 | include(CheckCXXCompilerFlag)
21 |
22 | function(add_cxx_compiler_flag FLAG)
23 | string(TOUPPER "HAVE_CXX_FLAG_${FLAG}" SANITIZED_FLAG)
24 | string(REPLACE "+" "X" SANITIZED_FLAG ${SANITIZED_FLAG})
25 | string(REGEX REPLACE "[^A-Za-z_0-9]" "_" SANITIZED_FLAG ${SANITIZED_FLAG})
26 | string(REGEX REPLACE "_+" "_" SANITIZED_FLAG ${SANITIZED_FLAG})
27 | set(CMAKE_REQUIRED_FLAGS "${FLAG}")
28 | check_cxx_compiler_flag("" ${SANITIZED_FLAG})
29 | if(${SANITIZED_FLAG})
30 | set(VARIANT ${ARGV1})
31 | if(ARGV1)
32 | string(TOUPPER "_${VARIANT}" VARIANT)
33 | endif()
34 | set(CMAKE_CXX_FLAGS${VARIANT} "${CMAKE_CXX_FLAGS${VARIANT}} ${FLAG}" PARENT_SCOPE)
35 | endif()
36 | endfunction()
37 |
38 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/cmake/CXXFeatureCheck.cmake:
--------------------------------------------------------------------------------
1 | # - Compile and run code to check for C++ features
2 | #
3 | # This functions compiles a source file under the `cmake` folder
4 | # and adds the corresponding `HAVE_[FILENAME]` flag to the CMake
5 | # environment
6 | #
7 | # cxx_feature_check( [])
8 | #
9 | # - Example
10 | #
11 | # include(CXXFeatureCheck)
12 | # cxx_feature_check(STD_REGEX)
13 | # Requires CMake 2.6+
14 |
15 | if(__cxx_feature_check)
16 | return()
17 | endif()
18 | set(__cxx_feature_check INCLUDED)
19 |
20 | function(cxx_feature_check FILE)
21 | string(TOLOWER ${FILE} FILE)
22 | string(TOUPPER ${FILE} VAR)
23 | string(TOUPPER "HAVE_${VAR}" FEATURE)
24 | message("-- Performing Test ${FEATURE}")
25 | try_run(RUN_${FEATURE} COMPILE_${FEATURE}
26 | ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${FILE}.cpp)
27 | if(RUN_${FEATURE} EQUAL 0)
28 | message("-- Performing Test ${FEATURE} -- success")
29 | set(HAVE_${VAR} 1 PARENT_SCOPE)
30 | add_definitions(-DHAVE_${VAR})
31 | else()
32 | if(NOT COMPILE_${FEATURE})
33 | message("-- Performing Test ${FEATURE} -- failed to compile")
34 | else()
35 | message("-- Performing Test ${FEATURE} -- compiled but failed to run")
36 | endif()
37 | endif()
38 | endfunction()
39 |
40 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/cmake/GetGitVersion.cmake:
--------------------------------------------------------------------------------
1 | # - Returns a version string from Git tags
2 | #
3 | # This function inspects the annotated git tags for the project and returns a string
4 | # into a CMake variable
5 | #
6 | # get_git_version()
7 | #
8 | # - Example
9 | #
10 | # include(GetGitVersion)
11 | # get_git_version(GIT_VERSION)
12 | #
13 | # Requires CMake 2.8.11+
14 | find_package(Git)
15 |
16 | if(__get_git_version)
17 | return()
18 | endif()
19 | set(__get_git_version INCLUDED)
20 |
21 | function(get_git_version var)
22 | if(GIT_EXECUTABLE)
23 | execute_process(COMMAND ${GIT_EXECUTABLE} describe --match "v[0-9]*.[0-9]*.[0-9]*" --abbrev=8
24 | RESULT_VARIABLE status
25 | OUTPUT_VARIABLE GIT_VERSION
26 | ERROR_QUIET)
27 | if(${status})
28 | set(GIT_VERSION "v0.0.0")
29 | else()
30 | string(STRIP ${GIT_VERSION} GIT_VERSION)
31 | string(REGEX REPLACE "-[0-9]+-g" "-" GIT_VERSION ${GIT_VERSION})
32 | endif()
33 |
34 | # Work out if the repository is dirty
35 | execute_process(COMMAND ${GIT_EXECUTABLE} update-index -q --refresh
36 | OUTPUT_QUIET
37 | ERROR_QUIET)
38 | execute_process(COMMAND ${GIT_EXECUTABLE} diff-index --name-only HEAD --
39 | OUTPUT_VARIABLE GIT_DIFF_INDEX
40 | ERROR_QUIET)
41 | string(COMPARE NOTEQUAL "${GIT_DIFF_INDEX}" "" GIT_DIRTY)
42 | if (${GIT_DIRTY})
43 | set(GIT_VERSION "${GIT_VERSION}-dirty")
44 | endif()
45 | else()
46 | set(GIT_VERSION "v0.0.0")
47 | endif()
48 |
49 | message("-- git Version: ${GIT_VERSION}")
50 | set(${var} ${GIT_VERSION} PARENT_SCOPE)
51 | endfunction()
52 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/cmake/gnu_posix_regex.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | int main() {
4 | std::string str = "test0159";
5 | regex_t re;
6 | int ec = regcomp(&re, "^[a-z]+[0-9]+$", REG_EXTENDED | REG_NOSUB);
7 | if (ec != 0) {
8 | return ec;
9 | }
10 | return regexec(&re, str.c_str(), 0, nullptr, 0) ? -1 : 0;
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/cmake/posix_regex.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | int main() {
4 | std::string str = "test0159";
5 | regex_t re;
6 | int ec = regcomp(&re, "^[a-z]+[0-9]+$", REG_EXTENDED | REG_NOSUB);
7 | if (ec != 0) {
8 | return ec;
9 | }
10 | int ret = regexec(&re, str.c_str(), 0, nullptr, 0) ? -1 : 0;
11 | regfree(&re);
12 | return ret;
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/cmake/std_regex.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | int main() {
4 | const std::string str = "test0159";
5 | std::regex re;
6 | re = std::regex("^[a-z]+[0-9]+$",
7 | std::regex_constants::extended | std::regex_constants::nosubs);
8 | return std::regex_search(str, re) ? 0 : -1;
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/cmake/steady_clock.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | int main() {
4 | typedef std::chrono::steady_clock Clock;
5 | Clock::time_point tp = Clock::now();
6 | ((void)tp);
7 | }
8 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/cmake/thread_safety_attributes.cpp:
--------------------------------------------------------------------------------
1 | #define HAVE_THREAD_SAFETY_ATTRIBUTES
2 | #include "../src/mutex.h"
3 |
4 | int main() {}
5 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/include/benchmark/benchmark.h:
--------------------------------------------------------------------------------
1 | // Copyright 2015 Google Inc. All rights reserved.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 | #ifndef BENCHMARK_BENCHMARK_H_
15 | #define BENCHMARK_BENCHMARK_H_
16 |
17 | #include "macros.h"
18 | #include "benchmark_api.h"
19 | #include "reporter.h"
20 |
21 | #endif // BENCHMARK_BENCHMARK_H_
22 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/include/benchmark/macros.h:
--------------------------------------------------------------------------------
1 | // Copyright 2015 Google Inc. All rights reserved.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 | #ifndef BENCHMARK_MACROS_H_
15 | #define BENCHMARK_MACROS_H_
16 |
17 | #if __cplusplus < 201103L
18 | # define BENCHMARK_DISALLOW_COPY_AND_ASSIGN(TypeName) \
19 | TypeName(const TypeName&); \
20 | TypeName& operator=(const TypeName&)
21 | #else
22 | # define BENCHMARK_DISALLOW_COPY_AND_ASSIGN(TypeName) \
23 | TypeName(const TypeName&) = delete; \
24 | TypeName& operator=(const TypeName&) = delete
25 | #endif
26 |
27 | #if defined(__GNUC__)
28 | # define BENCHMARK_UNUSED __attribute__((unused))
29 | # define BENCHMARK_ALWAYS_INLINE __attribute__((always_inline))
30 | # define BENCHMARK_NOEXCEPT noexcept
31 | #elif defined(_MSC_VER) && !defined(__clang__)
32 | # define BENCHMARK_UNUSED
33 | # define BENCHMARK_ALWAYS_INLINE __forceinline
34 | # define BENCHMARK_NOEXCEPT
35 | # define __func__ __FUNCTION__
36 | #else
37 | # define BENCHMARK_UNUSED
38 | # define BENCHMARK_ALWAYS_INLINE
39 | # define BENCHMARK_NOEXCEPT
40 | #endif
41 |
42 | #if defined(__GNUC__)
43 | # define BENCHMARK_BUILTIN_EXPECT(x, y) __builtin_expect(x, y)
44 | #else
45 | # define BENCHMARK_BUILTIN_EXPECT(x, y) x
46 | #endif
47 |
48 | #endif // BENCHMARK_MACROS_H_
49 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/src/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Allow the source files to find headers in src/
2 | include_directories(${PROJECT_SOURCE_DIR}/src)
3 |
4 | # Define the source files
5 | set(SOURCE_FILES "benchmark.cc" "colorprint.cc" "commandlineflags.cc"
6 | "console_reporter.cc" "csv_reporter.cc" "json_reporter.cc"
7 | "log.cc" "reporter.cc" "sleep.cc" "string_util.cc"
8 | "sysinfo.cc" "walltime.cc")
9 | # Determine the correct regular expression engine to use
10 | if(HAVE_STD_REGEX)
11 | set(RE_FILES "re_std.cc")
12 | elseif(HAVE_GNU_POSIX_REGEX)
13 | set(RE_FILES "re_posix.cc")
14 | elseif(HAVE_POSIX_REGEX)
15 | set(RE_FILES "re_posix.cc")
16 | else()
17 | message(FATAL_ERROR "Failed to determine the source files for the regular expression backend")
18 | endif()
19 |
20 | add_library(benchmark ${SOURCE_FILES} ${RE_FILES})
21 |
22 |
23 | set_target_properties(benchmark PROPERTIES
24 | OUTPUT_NAME "benchmark"
25 | VERSION ${GENERIC_LIB_VERSION}
26 | SOVERSION ${GENERIC_LIB_SOVERSION}
27 | )
28 |
29 | # Link threads.
30 | target_link_libraries(benchmark ${CMAKE_THREAD_LIBS_INIT})
31 |
32 | # We need extra libraries on Windows
33 | if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
34 | target_link_libraries(benchmark Shlwapi)
35 | endif()
36 |
37 | # Expose public API
38 | target_include_directories(benchmark PUBLIC ${PROJECT_SOURCE_DIR}/include)
39 |
40 | # Install target (will install the library to specified CMAKE_INSTALL_PREFIX variable)
41 | install(
42 | TARGETS benchmark
43 | ARCHIVE DESTINATION lib
44 | LIBRARY DESTINATION lib
45 | RUNTIME DESTINATION bin
46 | COMPONENT library)
47 |
48 | install(
49 | DIRECTORY "${PROJECT_SOURCE_DIR}/include/benchmark"
50 | DESTINATION include
51 | FILES_MATCHING PATTERN "*.*h")
52 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/src/INSTALL.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CMake Rules
6 |
7 |
8 |
9 |
10 | {204202EE-7A2D-3C35-88CF-0AE2C34270F4}
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/src/MinSizeRel/benchmark.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fenbf/benchmarkLibsTest/35cc3c702a929dd9156e10a62e4a15682a1b5c97/googleBenchmarkTest/benchmark-master32/src/MinSizeRel/benchmark.lib
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/src/RUN_TESTS.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CMake Rules
6 |
7 |
8 |
9 |
10 | {204202EE-7A2D-3C35-88CF-0AE2C34270F4}
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/src/arraysize.h:
--------------------------------------------------------------------------------
1 | #ifndef BENCHMARK_ARRAYSIZE_H_
2 | #define BENCHMARK_ARRAYSIZE_H_
3 |
4 | #include "internal_macros.h"
5 |
6 | namespace benchmark {
7 | namespace internal {
8 | // The arraysize(arr) macro returns the # of elements in an array arr.
9 | // The expression is a compile-time constant, and therefore can be
10 | // used in defining new arrays, for example. If you use arraysize on
11 | // a pointer by mistake, you will get a compile-time error.
12 | //
13 |
14 |
15 | // This template function declaration is used in defining arraysize.
16 | // Note that the function doesn't need an implementation, as we only
17 | // use its type.
18 | template
19 | char (&ArraySizeHelper(T (&array)[N]))[N];
20 |
21 | // That gcc wants both of these prototypes seems mysterious. VC, for
22 | // its part, can't decide which to use (another mystery). Matching of
23 | // template overloads: the final frontier.
24 | #ifndef COMPILER_MSVC
25 | template
26 | char (&ArraySizeHelper(const T (&array)[N]))[N];
27 | #endif
28 |
29 | #define arraysize(array) (sizeof(::benchmark::internal::ArraySizeHelper(array)))
30 |
31 | } // end namespace internal
32 | } // end namespace benchmark
33 |
34 | #endif // BENCHMARK_ARRAYSIZE_H_
35 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/src/check.h:
--------------------------------------------------------------------------------
1 | #ifndef CHECK_H_
2 | #define CHECK_H_
3 |
4 | #include
5 | #include
6 |
7 | #include "internal_macros.h"
8 | #include "log.h"
9 |
10 | namespace benchmark {
11 | namespace internal {
12 |
13 | // CheckHandler is the class constructed by failing CHECK macros. CheckHandler
14 | // will log information about the failures and abort when it is destructed.
15 | class CheckHandler {
16 | public:
17 | CheckHandler(const char* check, const char* file, const char* func, int line)
18 | : log_(GetErrorLogInstance())
19 | {
20 | log_ << file << ":" << line << ": " << func << ": Check `"
21 | << check << "' failed. ";
22 | }
23 |
24 | std::ostream& GetLog() {
25 | return log_;
26 | }
27 |
28 | BENCHMARK_NORETURN ~CheckHandler() {
29 | log_ << std::endl;
30 | std::abort();
31 | }
32 |
33 | CheckHandler & operator=(const CheckHandler&) = delete;
34 | CheckHandler(const CheckHandler&) = delete;
35 | CheckHandler() = delete;
36 | private:
37 | std::ostream& log_;
38 | };
39 |
40 | } // end namespace internal
41 | } // end namespace benchmark
42 |
43 | // The CHECK macro returns a std::ostream object that can have extra information
44 | // written to it.
45 | #ifndef NDEBUG
46 | # define CHECK(b) (b ? ::benchmark::internal::GetNullLogInstance() \
47 | : ::benchmark::internal::CheckHandler( \
48 | #b, __FILE__, __func__, __LINE__).GetLog())
49 | #else
50 | # define CHECK(b) ::benchmark::internal::GetNullLogInstance()
51 | #endif
52 |
53 | #define CHECK_EQ(a, b) CHECK((a) == (b))
54 | #define CHECK_NE(a, b) CHECK((a) != (b))
55 | #define CHECK_GE(a, b) CHECK((a) >= (b))
56 | #define CHECK_LE(a, b) CHECK((a) <= (b))
57 | #define CHECK_GT(a, b) CHECK((a) > (b))
58 | #define CHECK_LT(a, b) CHECK((a) < (b))
59 |
60 | #endif // CHECK_H_
61 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/src/colorprint.h:
--------------------------------------------------------------------------------
1 | #ifndef BENCHMARK_COLORPRINT_H_
2 | #define BENCHMARK_COLORPRINT_H_
3 |
4 | namespace benchmark {
5 | enum LogColor {
6 | COLOR_DEFAULT,
7 | COLOR_RED,
8 | COLOR_GREEN,
9 | COLOR_YELLOW,
10 | COLOR_BLUE,
11 | COLOR_MAGENTA,
12 | COLOR_CYAN,
13 | COLOR_WHITE
14 | };
15 |
16 | void ColorPrintf(LogColor color, const char* fmt, ...);
17 | } // end namespace benchmark
18 |
19 | #endif // BENCHMARK_COLORPRINT_H_
20 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/src/internal_macros.h:
--------------------------------------------------------------------------------
1 | #ifndef BENCHMARK_INTERNAL_MACROS_H_
2 | #define BENCHMARK_INTERNAL_MACROS_H_
3 |
4 | #include "benchmark/macros.h"
5 |
6 | #ifndef __has_feature
7 | # define __has_feature(x) 0
8 | #endif
9 |
10 | #if __has_feature(cxx_attributes)
11 | # define BENCHMARK_NORETURN [[noreturn]]
12 | #elif defined(__GNUC__)
13 | # define BENCHMARK_NORETURN __attribute__((noreturn))
14 | #else
15 | # define BENCHMARK_NORETURN
16 | #endif
17 |
18 | #if defined(__CYGWIN__)
19 | # define BENCHMARK_OS_CYGWIN 1
20 | #elif defined(_WIN32)
21 | # define BENCHMARK_OS_WINDOWS 1
22 | #elif defined(__APPLE__)
23 | // TODO(ericwf) This doesn't actually check that it is a Mac OSX system. Just
24 | // that it is an apple system.
25 | # define BENCHMARK_OS_MACOSX 1
26 | #elif defined(__FreeBSD__)
27 | # define BENCHMARK_OS_FREEBSD 1
28 | #elif defined(__linux__)
29 | # define BENCHMARK_OS_LINUX 1
30 | #endif
31 |
32 | #if defined(__clang__)
33 | # define COMPILER_CLANG
34 | #elif defined(_MSC_VER)
35 | # define COMPILER_MSVC
36 | #elif defined(__GNUC__)
37 | # define COMPILER_GCC
38 | #endif
39 |
40 | #endif // BENCHMARK_INTERNAL_MACROS_H_
41 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/src/log.cc:
--------------------------------------------------------------------------------
1 | #include "log.h"
2 |
3 | #include
4 |
5 | namespace benchmark {
6 | namespace internal {
7 |
8 | int& LoggingLevelImp() {
9 | static int level = 0;
10 | return level;
11 | }
12 |
13 | void SetLogLevel(int value) {
14 | LoggingLevelImp() = value;
15 | }
16 |
17 | int GetLogLevel() {
18 | return LoggingLevelImp();
19 | }
20 |
21 | class NullLogBuffer : public std::streambuf
22 | {
23 | public:
24 | int overflow(int c) {
25 | return c;
26 | }
27 | };
28 |
29 | std::ostream& GetNullLogInstance() {
30 | static NullLogBuffer log_buff;
31 | static std::ostream null_log(&log_buff);
32 | return null_log;
33 | }
34 |
35 | std::ostream& GetErrorLogInstance() {
36 | return std::clog;
37 | }
38 |
39 | } // end namespace internal
40 | } // end namespace benchmark
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/src/log.h:
--------------------------------------------------------------------------------
1 | #ifndef BENCHMARK_LOG_H_
2 | #define BENCHMARK_LOG_H_
3 |
4 | #include
5 |
6 | namespace benchmark {
7 | namespace internal {
8 |
9 | int GetLogLevel();
10 | void SetLogLevel(int level);
11 |
12 | std::ostream& GetNullLogInstance();
13 | std::ostream& GetErrorLogInstance();
14 |
15 | inline std::ostream& GetLogInstanceForLevel(int level) {
16 | if (level <= GetLogLevel()) {
17 | return GetErrorLogInstance();
18 | }
19 | return GetNullLogInstance();
20 | }
21 |
22 | } // end namespace internal
23 | } // end namespace benchmark
24 |
25 | #define VLOG(x) (::benchmark::internal::GetLogInstanceForLevel(x) \
26 | << "-- LOG(" << x << "): ")
27 |
28 | #endif
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/src/re.h:
--------------------------------------------------------------------------------
1 | // Copyright 2015 Google Inc. All rights reserved.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef BENCHMARK_RE_H_
16 | #define BENCHMARK_RE_H_
17 |
18 | #if defined(HAVE_STD_REGEX)
19 | #include
20 | #elif defined(HAVE_GNU_POSIX_REGEX)
21 | #include
22 | #elif defined(HAVE_POSIX_REGEX)
23 | #include
24 | #else
25 | #error No regular expression backend was found!
26 | #endif
27 | #include
28 |
29 | namespace benchmark {
30 |
31 | // A wrapper around the POSIX regular expression API that provides automatic
32 | // cleanup
33 | class Regex {
34 | public:
35 | Regex();
36 | ~Regex();
37 |
38 | // Compile a regular expression matcher from spec. Returns true on success.
39 | //
40 | // On failure (and if error is not nullptr), error is populated with a human
41 | // readable error message if an error occurs.
42 | bool Init(const std::string& spec, std::string* error);
43 |
44 | // Returns whether str matches the compiled regular expression.
45 | bool Match(const std::string& str);
46 | private:
47 | bool init_;
48 | // Underlying regular expression object
49 | #if defined(HAVE_STD_REGEX)
50 | std::regex re_;
51 | #elif defined(HAVE_POSIX_REGEX) || defined(HAVE_GNU_POSIX_REGEX)
52 | regex_t re_;
53 | #else
54 | # error No regular expression backend implementation available
55 | #endif
56 | };
57 |
58 | } // end namespace benchmark
59 |
60 | #endif // BENCHMARK_RE_H_
61 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/src/re_posix.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2015 Google Inc. All rights reserved.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #include "check.h"
16 | #include "re.h"
17 |
18 | namespace benchmark {
19 |
20 | Regex::Regex() : init_(false) { }
21 |
22 | bool Regex::Init(const std::string& spec, std::string* error) {
23 | int ec = regcomp(&re_, spec.c_str(), REG_EXTENDED | REG_NOSUB);
24 | if (ec != 0) {
25 | if (error) {
26 | size_t needed = regerror(ec, &re_, nullptr, 0);
27 | char* errbuf = new char[needed];
28 | regerror(ec, &re_, errbuf, needed);
29 |
30 | // regerror returns the number of bytes necessary to null terminate
31 | // the string, so we move that when assigning to error.
32 | CHECK_NE(needed, 0);
33 | error->assign(errbuf, needed - 1);
34 |
35 | delete[] errbuf;
36 | }
37 |
38 | return false;
39 | }
40 |
41 | init_ = true;
42 | return true;
43 | }
44 |
45 | Regex::~Regex() {
46 | if (init_) {
47 | regfree(&re_);
48 | }
49 | }
50 |
51 | bool Regex::Match(const std::string& str) {
52 | if (!init_) {
53 | return false;
54 | }
55 |
56 | return regexec(&re_, str.c_str(), 0, nullptr, 0) == 0;
57 | }
58 |
59 | } // end namespace benchmark
60 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/src/re_std.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2015 Google Inc. All rights reserved.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #include "re.h"
16 |
17 | namespace benchmark {
18 |
19 | Regex::Regex() : init_(false) { }
20 |
21 | bool Regex::Init(const std::string& spec, std::string* error) {
22 | try {
23 | re_ = std::regex(spec, std::regex_constants::extended);
24 |
25 | init_ = true;
26 | } catch (const std::regex_error& e) {
27 | if (error) {
28 | *error = e.what();
29 | }
30 | }
31 | return init_;
32 | }
33 |
34 | Regex::~Regex() { }
35 |
36 | bool Regex::Match(const std::string& str) {
37 | if (!init_) {
38 | return false;
39 | }
40 |
41 | return std::regex_search(str, re_);
42 | }
43 |
44 | } // end namespace benchmark
45 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/src/sleep.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2015 Google Inc. All rights reserved.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #include "sleep.h"
16 |
17 | #include
18 | #include
19 |
20 | #include "internal_macros.h"
21 |
22 | #ifdef BENCHMARK_OS_WINDOWS
23 | #include
24 | #endif
25 |
26 | namespace benchmark {
27 | #ifdef BENCHMARK_OS_WINDOWS
28 | // Window's Sleep takes milliseconds argument.
29 | void SleepForMilliseconds(int milliseconds) { Sleep(milliseconds); }
30 | void SleepForSeconds(double seconds) {
31 | SleepForMilliseconds(static_cast(kNumMillisPerSecond * seconds));
32 | }
33 | #else // BENCHMARK_OS_WINDOWS
34 | void SleepForMicroseconds(int microseconds) {
35 | struct timespec sleep_time;
36 | sleep_time.tv_sec = microseconds / kNumMicrosPerSecond;
37 | sleep_time.tv_nsec = (microseconds % kNumMicrosPerSecond) * kNumNanosPerMicro;
38 | while (nanosleep(&sleep_time, &sleep_time) != 0 && errno == EINTR)
39 | ; // Ignore signals and wait for the full interval to elapse.
40 | }
41 |
42 | void SleepForMilliseconds(int milliseconds) {
43 | SleepForMicroseconds(static_cast(milliseconds) * kNumMicrosPerMilli);
44 | }
45 |
46 | void SleepForSeconds(double seconds) {
47 | SleepForMicroseconds(static_cast(seconds * kNumMicrosPerSecond));
48 | }
49 | #endif // BENCHMARK_OS_WINDOWS
50 | } // end namespace benchmark
51 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/src/sleep.h:
--------------------------------------------------------------------------------
1 | #ifndef BENCHMARK_SLEEP_H_
2 | #define BENCHMARK_SLEEP_H_
3 |
4 | #include
5 |
6 | namespace benchmark {
7 | const int64_t kNumMillisPerSecond = 1000LL;
8 | const int64_t kNumMicrosPerMilli = 1000LL;
9 | const int64_t kNumMicrosPerSecond = kNumMillisPerSecond * 1000LL;
10 | const int64_t kNumNanosPerMicro = 1000LL;
11 | const int64_t kNumNanosPerSecond = kNumNanosPerMicro * kNumMicrosPerSecond;
12 |
13 | void SleepForMilliseconds(int milliseconds);
14 | void SleepForSeconds(double seconds);
15 | } // end namespace benchmark
16 |
17 | #endif // BENCHMARK_SLEEP_H_
18 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/src/string_util.h:
--------------------------------------------------------------------------------
1 | #ifndef BENCHMARK_STRING_UTIL_H_
2 | #define BENCHMARK_STRING_UTIL_H_
3 |
4 | #include
5 | #include
6 | #include
7 | #include "internal_macros.h"
8 |
9 | namespace benchmark {
10 |
11 | void AppendHumanReadable(int n, std::string* str);
12 |
13 | std::string HumanReadableNumber(double n);
14 |
15 | std::string StringPrintF(const char* format, ...);
16 |
17 | inline std::ostream&
18 | StringCatImp(std::ostream& out) BENCHMARK_NOEXCEPT
19 | {
20 | return out;
21 | }
22 |
23 | template
24 | inline std::ostream&
25 | StringCatImp(std::ostream& out, First&& f, Rest&&... rest)
26 | {
27 | out << std::forward(f);
28 | return StringCatImp(out, std::forward(rest)...);
29 | }
30 |
31 | template
32 | inline std::string StrCat(Args&&... args)
33 | {
34 | std::ostringstream ss;
35 | StringCatImp(ss, std::forward(args)...);
36 | return ss.str();
37 | }
38 |
39 | void ReplaceAll(std::string* str, const std::string& from,
40 | const std::string& to);
41 |
42 | } // end namespace benchmark
43 |
44 | #endif // BENCHMARK_STRING_UTIL_H_
45 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/src/sysinfo.h:
--------------------------------------------------------------------------------
1 | #ifndef BENCHMARK_SYSINFO_H_
2 | #define BENCHMARK_SYSINFO_H_
3 |
4 | namespace benchmark {
5 | double MyCPUUsage();
6 | double ChildrenCPUUsage();
7 | int NumCPUs();
8 | double CyclesPerSecond();
9 | bool CpuScalingEnabled();
10 | } // end namespace benchmark
11 |
12 | #endif // BENCHMARK_SYSINFO_H_
13 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/src/walltime.h:
--------------------------------------------------------------------------------
1 | #ifndef BENCHMARK_WALLTIME_H_
2 | #define BENCHMARK_WALLTIME_H_
3 |
4 | #include
5 |
6 | namespace benchmark {
7 | typedef double WallTime;
8 |
9 | namespace walltime {
10 | WallTime Now();
11 | } // end namespace walltime
12 |
13 | std::string LocalDateTimeString();
14 |
15 | } // end namespace benchmark
16 |
17 | #endif // BENCHMARK_WALLTIME_H_
18 |
--------------------------------------------------------------------------------
/googleBenchmarkTest/benchmark-master32/test/INSTALL.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |