Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
freeride:prgtst jester$ g++ -pthread -std=c++11 -O2 pipe.cpp
freeride:prgtst jester$ time ./a.out
Starting iteration.
On iteration 100000.
On iteration 200000.
On iteration 300000.
On iteration 400000.
On iteration 500000.
On iteration 600000.
On iteration 700000.
On iteration 800000.
On iteration 900000.
On iteration 1000000.
On iteration 1100000.
On iteration 1200000.
On iteration 1300000.
On iteration 1400000.
On iteration 1500000.
On iteration 1600000.
On iteration 1700000.
On iteration 1800000.
On iteration 1900000.
On iteration 2000000.
On iteration 2100000.
On iteration 2200000.
On iteration 2300000.
On iteration 2400000.
On iteration 2500000.
On iteration 2600000.
On iteration 2700000.
On iteration 2800000.
On iteration 2900000.
On iteration 3000000.
On iteration 3100000.
On iteration 3200000.
On iteration 3300000.
On iteration 3400000.
On iteration 3500000.
On iteration 3600000.
On iteration 3700000.
On iteration 3800000.
On iteration 3900000.
On iteration 4000000.
On iteration 4100000.
On iteration 4200000.
On iteration 4300000.
On iteration 4400000.
On iteration 4500000.
On iteration 4600000.
On iteration 4700000.
On iteration 4800000.
On iteration 4900000.
On iteration 5000000.
On iteration 5100000.
On iteration 5200000.
On iteration 5300000.
On iteration 5400000.
On iteration 5500000.
On iteration 5600000.
On iteration 5700000.
On iteration 5800000.
On iteration 5900000.
On iteration 6000000.
On iteration 6100000.
On iteration 6200000.
On iteration 6300000.
On iteration 6400000.
On iteration 6500000.
On iteration 6600000.
On iteration 6700000.
On iteration 6800000.
On iteration 6900000.
On iteration 7000000.
On iteration 7100000.
On iteration 7200000.
On iteration 7300000.
On iteration 7400000.
On iteration 7500000.
On iteration 7600000.
On iteration 7700000.
On iteration 7800000.
On iteration 7900000.
On iteration 8000000.
On iteration 8100000.
On iteration 8200000.
On iteration 8300000.
On iteration 8400000.
On iteration 8500000.
On iteration 8600000.
On iteration 8700000.
On iteration 8800000.
On iteration 8900000.
On iteration 9000000.
On iteration 9100000.
On iteration 9200000.
On iteration 9300000.
On iteration 9400000.
On iteration 9500000.
On iteration 9600000.
On iteration 9700000.
On iteration 9800000.
On iteration 9900000.
On iteration 10000000.
Ending iteration.
real 0m36.807s
user 0m7.564s
sys 0m29.534s
freeride:prgtst jester$ g++ -pthread -std=c++11 -O2 -DUSE_PIPES pipe.cpp
freeride:prgtst jester$ time ./a.out
Starting iteration.
On iteration 100000.
On iteration 200000.
On iteration 300000.
On iteration 400000.
On iteration 500000.
On iteration 600000.
On iteration 700000.
On iteration 800000.
On iteration 900000.
On iteration 1000000.
On iteration 1100000.
On iteration 1200000.
On iteration 1300000.
On iteration 1400000.
On iteration 1500000.
On iteration 1600000.
On iteration 1700000.
On iteration 1800000.
On iteration 1900000.
On iteration 2000000.
On iteration 2100000.
On iteration 2200000.
On iteration 2300000.
On iteration 2400000.
On iteration 2500000.
On iteration 2600000.
On iteration 2700000.
On iteration 2800000.
On iteration 2900000.
On iteration 3000000.
On iteration 3100000.
On iteration 3200000.
On iteration 3300000.
On iteration 3400000.
On iteration 3500000.
On iteration 3600000.
On iteration 3700000.
On iteration 3800000.
On iteration 3900000.
On iteration 4000000.
On iteration 4100000.
On iteration 4200000.
On iteration 4300000.
On iteration 4400000.
On iteration 4500000.
On iteration 4600000.
On iteration 4700000.
On iteration 4800000.
On iteration 4900000.
On iteration 5000000.
On iteration 5100000.
On iteration 5200000.
On iteration 5300000.
On iteration 5400000.
On iteration 5500000.
On iteration 5600000.
On iteration 5700000.
On iteration 5800000.
On iteration 5900000.
On iteration 6000000.
On iteration 6100000.
On iteration 6200000.
On iteration 6300000.
On iteration 6400000.
On iteration 6500000.
On iteration 6600000.
On iteration 6700000.
On iteration 6800000.
On iteration 6900000.
On iteration 7000000.
On iteration 7100000.
On iteration 7200000.
On iteration 7300000.
On iteration 7400000.
On iteration 7500000.
On iteration 7600000.
On iteration 7700000.
On iteration 7800000.
On iteration 7900000.
On iteration 8000000.
On iteration 8100000.
On iteration 8200000.
On iteration 8300000.
On iteration 8400000.
On iteration 8500000.
On iteration 8600000.
On iteration 8700000.
On iteration 8800000.
On iteration 8900000.
On iteration 9000000.
On iteration 9100000.
On iteration 9200000.
On iteration 9300000.
On iteration 9400000.
On iteration 9500000.
On iteration 9600000.
On iteration 9700000.
On iteration 9800000.
On iteration 9900000.
On iteration 10000000.
Ending iteration.
real 0m7.086s
user 0m1.774s
sys 0m12.169s
freeride:prgtst jester$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment