Skip to content

Instantly share code, notes, and snippets.

@sscalpone
Created April 2, 2020 22:56
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/11f58f248cc2a984be80a6b0867836ae to your computer and use it in GitHub Desktop.
Save sscalpone/11f58f248cc2a984be80a6b0867836ae to your computer and use it in GitHub Desktop.
+ 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.0
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: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 12
On-line CPU(s) list: 0-11
Thread(s) per core: 2
Core(s) per socket: 6
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 63
Model name: Intel(R) Core(TM) i7-5820K CPU @ 3.30GHz
Stepping: 2
CPU MHz: 1353.069
CPU max MHz: 3600.0000
CPU min MHz: 1200.0000
BogoMIPS: 6596.17
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 15360K
NUMA node0 CPU(s): 0-11
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti intel_ppin ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm xsaveopt cqm_llc cqm_occup_llc dtherm ida arat pln pts md_clear flush_l1d
+ g++ -O3 -std=c++11 ./modifiedbench.cpp -DREMOVE_CARRIAGE_RETURNS -DUSE_CR
+ ./a.out
996147
real 0m3.951s
user 0m3.946s
sys 0m0.004s
+ g++ -O3 -std=c++11 ./modifiedbench.cpp -DREMOVE_IF -DUSE_CR
+ ./a.out
996147
real 0m7.177s
user 0m7.169s
sys 0m0.008s
+ g++ -O3 -std=c++11 ./modifiedbench.cpp -DREMOVE_CARRIAGE_RETURNS -DUSE_NL
+ ./a.out
1048576
real 0m1.086s
user 0m1.082s
sys 0m0.004s
+ g++ -O3 -std=c++11 ./modifiedbench.cpp -DREMOVE_IF -DUSE_NL
+ ./a.out
1048576
real 0m3.176s
user 0m3.175s
sys 0m0.000s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment