[racket-dev] gcc flag -march=native
On a whim I tested racket by setting my CFLAGS to "-O2 -g
-march=native" and running the collects/tests/racket/benchmark/common
tests. Basically -march=native doesn't help a whole lot, but I guess the
good news is that it works at all. Previous attempts (from years ago)
claim various compilation/runtime errors:
http://article.gmane.org/gmane.lisp.scheme.plt/5261/match=march+gcc
http://article.gmane.org/gmane.lisp.scheme.plt/22819/match=march+gcc
It probably has more to do with gcc 4 being better than gcc 3 than
racket's code improving. Anyway here are the outputs from the benchmark
runs:
* Using -O2 -march=native -g
[racket conform (#f #f #f) #f]
[racket cpstack (10088 10447 1244) 669]
[racket cpstack (9796 9821 1180) 669]
[racket cpstack (10168 10451 1136) 669]
[racket ctak (12792 13037 1692) 545]
[racket ctak (12300 13217 1680) 545]
[racket ctak (12776 13285 1660) 545]
[racket deriv (11944 12529 768) 555]
[racket deriv (12552 13136 780) 555]
[racket deriv (11776 11855 728) 555]
[racket dderiv (12168 12534 748) 548]
[racket dderiv (11340 11479 764) 548]
[racket dderiv (12668 13323 800) 548]
[racket destruct (#f #f #f) #f]
[racket div (11744 12458 1472) 510]
[racket div (11276 11384 1228) 510]
[racket div (11488 11894 1536) 510]
[racket dynamic (#f #f #f) #f]
[racket dynamic2 (2124 2263 832) 978]
[racket dynamic2 (2080 2101 820) 978]
[racket dynamic2 (2136 2232 820) 978]
[racket earley (656 676 380) 702]
[racket earley (596 633 356) 702]
[racket earley (596 664 352) 702]
[racket fft (9740 10147 960) 460]
[racket fft (9596 9761 924) 460]
[racket fft (9284 9339 880) 460]
[racket graphs (9668 9811 892) 660]
[racket graphs (9804 10158 892) 660]
[racket graphs (9576 9730 900) 660]
[racket lattice (#f #f #f) #f]
[racket lattice2 (14760 14984 176) 407]
[racket lattice2 (14660 15090 176) 407]
[racket lattice2 (15040 15542 180) 407]
[racket maze (#f #f #f) #f]
[racket maze2 (10964 11344 340) 625]
[racket maze2 (10900 11010 356) 625]
[racket maze2 (10948 11101 360) 625]
[racket mazefun (17093 17192 532) 521]
[racket mazefun (17457 17799 532) 521]
[racket mazefun (17433 17632 564) 521]
[racket nboyer (5648 5671 3220) 617]
[racket nboyer (5672 5758 3224) 617]
[racket nboyer (5732 5748 3264) 617]
[racket nestedloop (16077 16188 0) 516]
[racket nestedloop (16133 16245 0) 516]
[racket nestedloop (15981 16406 0) 516]
[racket nfa (15817 15947 0) 585]
[racket nfa (16105 16804 0) 585]
[racket nfa (16033 16385 0) 585]
[racket nothing (0 0 0) 457]
[racket nothing (0 0 0) 457]
[racket nothing (0 0 0) 457]
[racket nqueens (9116 10251 356) 475]
[racket nqueens (9424 9976 344) 475]
[racket nqueens (8824 9183 356) 475]
[racket nucleic2 (20053 21348 2044) 2538]
[racket nucleic2 (19649 20568 1960) 2538]
[racket nucleic2 (19677 19995 1988) 2538]
[racket nucleic3 (21505 21621 1868) 1193]
[racket nucleic3 (21041 21428 1756) 1193]
[racket nucleic3 (22169 22322 1925) 1193]
[racket paraffins (12312 12406 4944) 546]
[racket paraffins (12400 12447 4884) 546]
[racket paraffins (12320 12337 4860) 546]
[racket peval (#f #f #f) #f]
[racket puzzle (14068 14291 0) 357]
[racket puzzle (14084 14193 0) 357]
[racket puzzle (14016 14125 0) 357]
[racket ray (24789 24955 1721) 604]
[racket ray (25049 25883 1676) 604]
[racket ray (25121 25998 1680) 604]
[racket sboyer (7648 7758 1252) 586]
[racket sboyer (7900 7935 1236) 586]
[racket sboyer (7932 8045 1232) 586]
[racket scheme (#f #f #f) #f]
[racket scheme2 (508 520 88) 809]
[racket scheme2 (512 539 88) 809]
[racket scheme2 (540 568 96) 809]
[racket sort1 (#f #f #f) #f]
[racket tak (11028 11140 0) 580]
[racket tak (11112 11187 0) 580]
[racket tak (10992 11215 0) 580]
[racket takl (17065 17228 0) 519]
[racket takl (17061 17134 0) 519]
[racket takl (17125 17350 0) 519]
[racket takr (7268 7381 0) 1169]
[racket takr (7116 7450 0) 1169]
[racket takr (7144 7457 0) 1169]
[racket takr2 (7644 7663 0) 908]
[racket takr2 (7440 7449 0) 908]
[racket takr2 (7516 7629 0) 908]
[racket triangle (16865 17378 0) 461]
[racket triangle (16457 16517 0) 461]
[racket triangle (16637 16817 0) 461]
* Using the default flags, -O2 -g
[racket conform (#f #f #f) #f]
[racket cpstack (10292 10812 1240) 615]
[racket cpstack (10380 11094 1204) 615]
[racket cpstack (10480 11409 1204) 615]
[racket ctak (13108 14313 1824) 708]
[racket ctak (12808 13468 1700) 708]
[racket ctak (13028 14316 1812) 708]
[racket deriv (13936 14681 780) 583]
[racket deriv (12544 13650 808) 583]
[racket deriv (12628 13293 768) 583]
[racket dderiv (12180 13030 876) 709]
[racket dderiv (12344 13091 816) 709]
[racket dderiv (11772 13043 772) 709]
[racket destruct (#f #f #f) #f]
[racket div (11368 12192 1508) 522]
[racket div (11508 11923 1392) 522]
[racket div (11204 11797 1408) 522]
[racket dynamic (#f #f #f) #f]
[racket dynamic2 (2104 2136 828) 1143]
[racket dynamic2 (2136 2144 832) 1143]
[racket dynamic2 (2128 2134 824) 1143]
[racket earley (620 632 352) 682]
[racket earley (604 644 356) 682]
[racket earley (620 621 364) 682]
[racket fft (9744 10023 976) 458]
[racket fft (9420 9483 944) 458]
[racket fft (9328 9452 936) 458]
[racket graphs (9928 10334 964) 547]
[racket graphs (9988 10459 904) 547]
[racket graphs (9716 9840 876) 547]
[racket lattice (#f #f #f) #f]
[racket lattice2 (14584 15104 180) 746]
[racket lattice2 (14644 14877 172) 746]
[racket lattice2 (14656 14801 176) 746]
[racket maze (#f #f #f) #f]
[racket maze2 (10868 11353 308) 665]
[racket maze2 (10724 10820 308) 665]
[racket maze2 (10920 11134 292) 665]
[racket mazefun (18345 18716 588) 615]
[racket mazefun (17605 17854 612) 615]
[racket mazefun (16985 17904 540) 615]
[racket nboyer (5736 6140 3272) 795]
[racket nboyer (5744 5792 3252) 795]
[racket nboyer (6024 6292 3408) 795]
[racket nestedloop (15869 16126 0) 737]
[racket nestedloop (15989 16094 0) 737]
[racket nestedloop (15729 15870 0) 737]
[racket nfa (16137 16541 0) 522]
[racket nfa (16093 16385 0) 522]
[racket nfa (16061 16209 0) 522]
[racket nothing (0 0 0) 439]
[racket nothing (0 0 0) 439]
[racket nothing (0 0 0) 439]
[racket nqueens (9348 9437 324) 455]
[racket nqueens (9080 9491 400) 455]
[racket nqueens (9272 9473 368) 455]
[racket nucleic2 (20245 20526 2016) 2347]
[racket nucleic2 (20057 20173 1925) 2347]
[racket nucleic2 (19889 20468 1944) 2347]
[racket nucleic3 (22417 22745 1729) 1257]
[racket nucleic3 (22341 22419 1836) 1257]
[racket nucleic3 (21697 21866 1720) 1257]
[racket paraffins (12340 12543 4952) 704]
[racket paraffins (12420 12952 4984) 704]
[racket paraffins (12468 12635 4972) 704]
[racket peval (#f #f #f) #f]
[racket puzzle (14224 14663 0) 590]
[racket puzzle (14064 14262 0) 590]
[racket puzzle (14000 14477 0) 590]
[racket ray (25673 26936 1700) 550]
[racket ray (25253 25833 1644) 550]
[racket ray (25077 26320 1612) 550]
[racket sboyer (7608 7729 1184) 767]
[racket sboyer (7652 7745 1164) 767]
[racket sboyer (7820 8194 1208) 767]
[racket scheme (#f #f #f) #f]
[racket scheme2 (508 530 88) 736]
[racket scheme2 (492 522 88) 736]
[racket scheme2 (536 619 88) 736]
[racket sort1 (#f #f #f) #f]
[racket tak (10812 11363 0) 579]
[racket tak (10944 11323 0) 579]
[racket tak (11356 11941 0) 579]
[racket takl (17509 18399 0) 378]
[racket takl (17729 18021 0) 378]
[racket takl (17405 17816 0) 378]
[racket takr (7644 8035 0) 1246]
[racket takr (7720 8066 0) 1246]
[racket takr (7624 7988 0) 1246]
[racket takr2 (7620 7745 0) 990]
[racket takr2 (7856 8114 0) 990]
[racket takr2 (8036 8610 0) 990]
[racket triangle (17013 17447 0) 714]
[racket triangle (16945 17321 0) 714]
[racket triangle (17169 17427 0) 714]