Skip to content

Instantly share code, notes, and snippets.

@sscalpone
Created April 2, 2020 23:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sscalpone/8aaec89cadb27c7ee580c6f460c955f4 to your computer and use it in GitHub Desktop.
Save sscalpone/8aaec89cadb27c7ee580c6f460c955f4 to your computer and use it in GitHub Desktop.
% sh -x do.sh
+ diff modifiedbench.cpp /home/sjs/klauslerbench.cpp
8,10d7
< //
< // The linux common case does not have carriage returns
< // Define USE_NL or USE_CR
65d61
< #if USE_CR
67,71d62
< #elif USE_NL
< src[j] = '\n';
< #else
< #error "Plese define one of USE_NL or USE_CR"
< #endif
+ g++ --version
g++ (GCC) 8.3.1 20190507 (Red Hat 8.3.1-4)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ lscpu
Architecture: aarch64
Byte Order: Little Endian
CPU(s): 224
On-line CPU(s) list: 0-223
Thread(s) per core: 4
Core(s) per socket: 28
Socket(s): 2
NUMA node(s): 2
Vendor ID: Cavium
Model: 1
Model name: ThunderX2 99xx
Stepping: 0x1
BogoMIPS: 400.00
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 32768K
NUMA node0 CPU(s): 0-111
NUMA node1 CPU(s): 112-223
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics cpuid asimdrdm
+ g++ -O3 -std=c++11 ./modifiedbench.cpp -DREMOVE_CARRIAGE_RETURNS -DUSE_CR
+ ./a.out
996147
real 0m16.454s
user 0m16.454s
sys 0m0.000s
+ g++ -O3 -std=c++11 ./modifiedbench.cpp -DREMOVE_IF -DUSE_CR
+ ./a.out
996147
real 0m11.794s
user 0m11.794s
sys 0m0.000s
+ g++ -O3 -std=c++11 ./modifiedbench.cpp -DREMOVE_CARRIAGE_RETURNS -DUSE_NL
+ ./a.out
1048576
real 0m2.350s
user 0m2.340s
sys 0m0.010s
+ g++ -O3 -std=c++11 ./modifiedbench.cpp -DREMOVE_IF -DUSE_NL
+ ./a.out
1048576
real 0m7.825s
user 0m7.825s
sys 0m0.000s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment