Lines Matching +full:real +full:- +full:time
4 optimization at `-O3` with link-time optimization (`-flto`) will result in the
5 best performance. However, using `-march=native` can result in **WORSE**
17 These benchmarks were run with both `bc`'s compiled with the typical `-O2`
18 optimizations and no link-time optimization.
31 real 2.54
39 real 0.88
55 real 2.51
63 real 0.91
79 real 7.15
87 real 2.20
103 real 3.36
111 real 1.61
121 printf '1234567890^100000; halt\n' | time -p [bc] -q > /dev/null
127 real 11.30
135 real 0.73
146 --- ../timeconst.bc 2018-09-28 11:32:22.808669000 -0600
147 +++ ../timeconst.bc 2019-06-07 07:26:36.359913078 -0600
148 @@ -110,8 +110,10 @@
152 - halt
155 -hz = read();
156 -timeconst(hz)
167 time -p [bc] ../timeconst.bc > /dev/null
173 real 16.71
181 real 13.16
204 time -p [bc] ../test.bc > /dev/null
210 real 16.60
218 real 22.76
240 time -p [bc] ../test2.bc > /dev/null
246 real 17.32
254 real 16.98
267 I recommended for version `2.7.0`, which are `-O3 -flto -march=native`.
269 This `bc` separates its code into modules that, when optimized at link time,
272 one instruction (on `x86_64`) when optimized at link time and inlined. There are
275 I also recommended `-march=native` on the grounds that newer instructions would
276 increase performance on math-heavy code. We will see if that assumption was
293 real 2.44
301 real 0.59
317 real 2.42
325 real 0.64
341 real 7.01
349 real 1.59
365 real 3.26
373 real 1.24
383 printf '1234567890^100000; halt\n' | time -p [bc] -q > /dev/null
389 real 11.08
397 real 0.71
407 time -p [bc] ../timeconst.bc > /dev/null
413 real 15.62
421 real 10.09
429 time -p [bc] ../test.bc > /dev/null
435 real 14.76
443 real 17.95
451 time -p [bc] ../test2.bc > /dev/null
457 real 14.84
465 real 13.53
470 ## Link-Time Optimization Only
472 Just for kicks, let's see if `-march=native` is even useful.
474 The optimizations I used for both `bc`'s were `-O3 -flto`.
487 real 2.41
495 real 0.58
511 real 2.39
519 real 0.65
535 real 6.82
543 real 1.57
559 real 3.25
567 real 1.27
577 printf '1234567890^100000; halt\n' | time -p [bc] -q > /dev/null
583 real 10.50
591 real 0.72
601 time -p [bc] ../timeconst.bc > /dev/null
607 real 15.50
615 real 10.17
623 time -p [bc] ../test.bc > /dev/null
629 real 14.99
637 real 16.85
645 time -p [bc] ../test2.bc > /dev/null
651 real 14.92
659 real 12.75
664 It turns out that `-march=native` can be a problem. As such, I have removed the
665 recommendation to build with `-march=native`.
673 [1]: https://github.com/torvalds/linux/blob/master/kernel/time/timeconst.bc