Last active
October 15, 2016 18:00
-
-
Save fcamel/3c0503adfa63f89e28db471bec0919c0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ g++ --version | |
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 | |
Apple LLVM version 8.0.0 (clang-800.0.38) | |
Target: x86_64-apple-darwin15.6.0 | |
Thread model: posix | |
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin | |
$ g++ count_bits.cpp -o count_bits -std=c++11 -O0 | |
$ ./count_bits | |
count_by_table : sum=7999011000, duration=1735250964ns | |
count_by_bit_operation: sum=7999011000, duration=1024207704ns | |
$ g++ count_bits.cpp -o count_bits -std=c++11 -O3 | |
$ ./count_bits | |
count_by_table : sum=7997909000, duration=513859720ns | |
count_by_bit_operation: sum=7997909000, duration=343567094ns |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment