ctime-results

来自「A C++ class library for scientific compu」· 代码 · 共 95 行

TXT
95
字号
On olympus.extreme.indiana.edu (sparc-sun-solaris2.6):egcs 1.1bInitial version, with -O2 -ftemplate-depth-30 -O2 -funroll-loops   -fstrict-aliasing ctime1    17.7 0.9ctime2    25.7 1.2ctime3    52.0 2.1ctime4   sleepWith -fno-gcse:ctime1	17.3 1.0ctime2  26.3 1.3ctime3  1:02.0 2.1ctime4  sleepWith -O:ctime1	17.3 0.8ctime2	24.4 1.2ctime3  51.5 2.1ctime4	sleepWith -O -fno-inline:ctime1	16.9 0.8ctime2	20.0 1.0ctime3	24.7 1.2ctime4	31.2 1.6Woohoo.  Okay, obviously inlining is the key.Now try new expression templates:With -O -funroll-loops -DBZ_NEW_EXPRESSION_TEMPLATESctime1	14.1 0.9ctime2	22.3 1.2ctime3	58.8 2.2With -O -funroll-loops -DBZ_NEW_EXPRESSION_TEMPLATES -DBZ_NO_INLINE_ETctime1  14.1 0.9ctime2	21.1 1.0ctime3	45.4 1.9With -O -funroll-loops -DBZ_NEW_EXPRESSION_TEMPLATES -DBZ_NO_INLINE_ET -DBZ_ETPARMS_CONSTREFctime1	14.6 0.8ctime2	20.7 1.1ctime3	41.6 2.1ctime4 1:27.7 3.0Things to try:-fno-inlineJust -O (this will turn off -funroll-all-loops)-fno-expensive-optimizations-fno-unroll-all-loops-fno-strength-reduce-fno-rerun-cse-after-loopOn hgar1.cwru.edu (alpha), with KCC:With +K3 -O3 -DBZ_NEW_EXPRESSION_TEMPLATES -DBZ_NO_INLINE_ET -DBZ_ETPARMS_CONSTREF:ctime1  13.1 0.8ctime2  20.9 1.0ctime3  27.3 1.0ctime4  36.2 1.1ctime5	48.7 1.2With just +K3 -O3:ctime1	15.8 0.9ctime2	25.3 1.0ctime3	46.2 1.2ctime4	79.9 1.5So a speed up of about X 2 with KCC, not counting the overhead.Here are the results for <valarray>:ctime1  0.9 0.2ctime2	2.1 0.2ctime3	9.4 0.3ctime4  33.2 0.4ctime5	1:13 0.6For C code:ctime5  0.35 0.08Pretty terrible.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?