Sign in to follow this  
Followers 0

CPU Optimizations

86 posts in this topic

Posted

Hi All,

I have been playing around with some Compiler Optimizations in the Linux Kernel. I want to know what your results are if you run this in a terminal.

Whats your Hardware and whats your kernel version?

time echo "scale=5000; a(1)*4" | bc -l

Share this post


Link to post
Share on other sites

Posted


3.141592653589793238462643383279502884197169399375105820974944592307\

81640628620899862803482534211706798214808651328230664709384460955058\

22317253594081284811174502841027019385211055596446229489549303819644\

28810975665933446128475648233786783165271201909145648566923460348610\

45432664821339360726024914127372458700660631558817488152092096282925\

40917153643678925903600113305305488204665213841469519415116094330572\

70365759591953092186117381932611793105118548074462379962749567351885\

75272489122793818301194912983367336244065664308602139494639522473719\

07021798609437027705392171762931767523846748184676694051320005681271\

45263560827785771342757789609173637178721468440901224953430146549585\

37105079227968925892354201995611212902196086403441815981362977477130\

99605187072113499999983729780499510597317328160963185950244594553469\

08302642522308253344685035261931188171010003137838752886587533208381\

42061717766914730359825349042875546873115956286388235378759375195778\

18577805321712268066130019278766111959092164201989380952572010654858\

63278865936153381827968230301952035301852968995773622599413891249721\

77528347913151557485724245415069595082953311686172785588907509838175\

46374649393192550604009277016711390098488240128583616035637076601047\

10181942955596198946767837449448255379774726847104047534646208046684\

25906949129331367702898915210475216205696602405803815019351125338243\

00355876402474964732639141992726042699227967823547816360093417216412\

19924586315030286182974555706749838505494588586926995690927210797509\

30295532116534498720275596023648066549911988183479775356636980742654\

25278625518184175746728909777727938000816470600161452491921732172147\

72350141441973568548161361157352552133475741849468438523323907394143\

33454776241686251898356948556209921922218427255025425688767179049460\

16534668049886272327917860857843838279679766814541009538837863609506\

80064225125205117392984896084128488626945604241965285022210661186306\

74427862203919494504712371378696095636437191728746776465757396241389\

08658326459958133904780275900994657640789512694683983525957098258226\

20522489407726719478268482601476990902640136394437455305068203496252\

45174939965143142980919065925093722169646151570985838741059788595977\

29754989301617539284681382686838689427741559918559252459539594310499\

72524680845987273644695848653836736222626099124608051243884390451244\

13654976278079771569143599770012961608944169486855584840635342207222\

58284886481584560285060168427394522674676788952521385225499546667278\

23986456596116354886230577456498035593634568174324112515076069479451\

09659609402522887971089314566913686722874894056010150330861792868092\

08747609178249385890097149096759852613655497818931297848216829989487\

22658804857564014270477555132379641451523746234364542858444795265867\

82105114135473573952311342716610213596953623144295248493718711014576\

54035902799344037420073105785390621983874478084784896833214457138687\

51943506430218453191048481005370614680674919278191197939952061419663\

42875444064374512371819217999839101591956181467514269123974894090718\

64942319615679452080951465502252316038819301420937621378559566389377\

87083039069792077346722182562599661501421503068038447734549202605414\

66592520149744285073251866600213243408819071048633173464965145390579\

62685610055081066587969981635747363840525714591028970641401109712062\

80439039759515677157700420337869936007230558763176359421873125147120\

53292819182618612586732157919841484882916447060957527069572209175671\

16722910981690915280173506712748583222871835209353965725121083579151\

36988209144421006751033467110314126711136990865851639831501970165151\

16851714376576183515565088490998985998238734552833163550764791853589\

32261854896321329330898570642046752590709154814165498594616371802709\

81994309924488957571282890592323326097299712084433573265489382391193\

25974636673058360414281388303203824903758985243744170291327656180937\

73444030707469211201913020330380197621101100449293215160842444859637\

66983895228684783123552658213144957685726243344189303968642624341077\

32269780280731891544110104468232527162010526522721116603966655730925\

47110557853763466820653109896526918620564769312570586356620185581007\

29360659876486117910453348850346113657686753249441668039626579787718\

55608455296541266540853061434443185867697514566140680070023787765913\

44017127494704205622305389945613140711270004078547332699390814546646\

45880797270826683063432858785698305235808933065757406795457163775254\

20211495576158140025012622859413021647155097925923099079654737612551\

76567513575178296664547791745011299614890304639947132962107340437518\

95735961458901938971311179042978285647503203198691514028708085990480\

10941214722131794764777262241425485454033215718530614228813758504306\

33217518297986622371721591607716692547487389866549494501146540628433\

66393790039769265672146385306736096571209180763832716641627488880078\

69256029022847210403172118608204190004229661711963779213375751149595\

01566049631862947265473642523081770367515906735023507283540567040386\

74351362222477158915049530984448933309634087807693259939780541934144\

73774418426312986080998886874132604720

real 0m17.893s

user 0m17.837s

sys 0m0.028s

What's that supposed to mean? :huh:

Share this post


Link to post
Share on other sites

Posted

Is that the number pi?

Share this post


Link to post
Share on other sites

Posted

Pi is 1.34~

Share this post


Link to post
Share on other sites

Posted

Note to all: You should never mindlessly type commands into a console when asked without researching and understanding their function.

1 person likes this

Share this post


Link to post
Share on other sites

Posted

Yeah I should have mentioned that it calculates Pi. Im a trust worthy member around here... Sort of :-p But yeah

Note to all: You should never mindlessly type commands into a console when asked without researching and understanding their function.

Yours does it faster than my hardware! Mine does it in 22seconds! ...What hardware are you running?

Share this post


Link to post
Share on other sites

Posted

unless it says sudo, you won't do that much...

I have an i5 3570K (no OC yet), and ASRock Extreme 3

Share this post


Link to post
Share on other sites

Posted


3.141592653589793238462643383279502884197169399375105820974944592307\

81640628620899862803482534211706798214808651328230664709384460955058\

22317253594081284811174502841027019385211055596446229489549303819644\

28810975665933446128475648233786783165271201909145648566923460348610\

45432664821339360726024914127372458700660631558817488152092096282925\

40917153643678925903600113305305488204665213841469519415116094330572\

70365759591953092186117381932611793105118548074462379962749567351885\

75272489122793818301194912983367336244065664308602139494639522473719\

07021798609437027705392171762931767523846748184676694051320005681271\

45263560827785771342757789609173637178721468440901224953430146549585\

37105079227968925892354201995611212902196086403441815981362977477130\

99605187072113499999983729780499510597317328160963185950244594553469\

08302642522308253344685035261931188171010003137838752886587533208381\

42061717766914730359825349042875546873115956286388235378759375195778\

18577805321712268066130019278766111959092164201989380952572010654858\

63278865936153381827968230301952035301852968995773622599413891249721\

77528347913151557485724245415069595082953311686172785588907509838175\

46374649393192550604009277016711390098488240128583616035637076601047\

10181942955596198946767837449448255379774726847104047534646208046684\

25906949129331367702898915210475216205696602405803815019351125338243\

00355876402474964732639141992726042699227967823547816360093417216412\

19924586315030286182974555706749838505494588586926995690927210797509\

30295532116534498720275596023648066549911988183479775356636980742654\

25278625518184175746728909777727938000816470600161452491921732172147\

72350141441973568548161361157352552133475741849468438523323907394143\

33454776241686251898356948556209921922218427255025425688767179049460\

16534668049886272327917860857843838279679766814541009538837863609506\

80064225125205117392984896084128488626945604241965285022210661186306\

74427862203919494504712371378696095636437191728746776465757396241389\

08658326459958133904780275900994657640789512694683983525957098258226\

20522489407726719478268482601476990902640136394437455305068203496252\

45174939965143142980919065925093722169646151570985838741059788595977\

29754989301617539284681382686838689427741559918559252459539594310499\

72524680845987273644695848653836736222626099124608051243884390451244\

13654976278079771569143599770012961608944169486855584840635342207222\

58284886481584560285060168427394522674676788952521385225499546667278\

23986456596116354886230577456498035593634568174324112515076069479451\

09659609402522887971089314566913686722874894056010150330861792868092\

08747609178249385890097149096759852613655497818931297848216829989487\

22658804857564014270477555132379641451523746234364542858444795265867\

82105114135473573952311342716610213596953623144295248493718711014576\

54035902799344037420073105785390621983874478084784896833214457138687\

51943506430218453191048481005370614680674919278191197939952061419663\

42875444064374512371819217999839101591956181467514269123974894090718\

64942319615679452080951465502252316038819301420937621378559566389377\

87083039069792077346722182562599661501421503068038447734549202605414\

66592520149744285073251866600213243408819071048633173464965145390579\

62685610055081066587969981635747363840525714591028970641401109712062\

80439039759515677157700420337869936007230558763176359421873125147120\

53292819182618612586732157919841484882916447060957527069572209175671\

16722910981690915280173506712748583222871835209353965725121083579151\

36988209144421006751033467110314126711136990865851639831501970165151\

16851714376576183515565088490998985998238734552833163550764791853589\

32261854896321329330898570642046752590709154814165498594616371802709\

81994309924488957571282890592323326097299712084433573265489382391193\

25974636673058360414281388303203824903758985243744170291327656180937\

73444030707469211201913020330380197621101100449293215160842444859637\

66983895228684783123552658213144957685726243344189303968642624341077\

32269780280731891544110104468232527162010526522721116603966655730925\

47110557853763466820653109896526918620564769312570586356620185581007\

29360659876486117910453348850346113657686753249441668039626579787718\

55608455296541266540853061434443185867697514566140680070023787765913\

44017127494704205622305389945613140711270004078547332699390814546646\

45880797270826683063432858785698305235808933065757406795457163775254\

20211495576158140025012622859413021647155097925923099079654737612551\

76567513575178296664547791745011299614890304639947132962107340437518\

95735961458901938971311179042978285647503203198691514028708085990480\

10941214722131794764777262241425485454033215718530614228813758504306\

33217518297986622371721591607716692547487389866549494501146540628433\

66393790039769265672146385306736096571209180763832716641627488880078\

69256029022847210403172118608204190004229661711963779213375751149595\

01566049631862947265473642523081770367515906735023507283540567040386\

74351362222477158915049530984448933309634087807693259939780541934144\

73774418426312986080998886874132604720


real    0m49.791s

user    0m49.520s

sys    0m0.013s

Hardware

  • Intel Core 2 Duo CPU T5250 (-MCP-) clocked at 1500.000 Mhz
  • 2GB RAM

    Kernel

    • 3.8.7-1-ARCH x86_64

Share this post


Link to post
Share on other sites

Posted


3.141592653589793238462643383279502884197169399375105820974944592307\

81640628620899862803482534211706798214808651328230664709384460955058\

22317253594081284811174502841027019385211055596446229489549303819644\

28810975665933446128475648233786783165271201909145648566923460348610\

45432664821339360726024914127372458700660631558817488152092096282925\

40917153643678925903600113305305488204665213841469519415116094330572\

70365759591953092186117381932611793105118548074462379962749567351885\

75272489122793818301194912983367336244065664308602139494639522473719\

07021798609437027705392171762931767523846748184676694051320005681271\

45263560827785771342757789609173637178721468440901224953430146549585\

37105079227968925892354201995611212902196086403441815981362977477130\

99605187072113499999983729780499510597317328160963185950244594553469\

08302642522308253344685035261931188171010003137838752886587533208381\

42061717766914730359825349042875546873115956286388235378759375195778\

18577805321712268066130019278766111959092164201989380952572010654858\

63278865936153381827968230301952035301852968995773622599413891249721\

77528347913151557485724245415069595082953311686172785588907509838175\

46374649393192550604009277016711390098488240128583616035637076601047\

10181942955596198946767837449448255379774726847104047534646208046684\

25906949129331367702898915210475216205696602405803815019351125338243\

00355876402474964732639141992726042699227967823547816360093417216412\

19924586315030286182974555706749838505494588586926995690927210797509\

30295532116534498720275596023648066549911988183479775356636980742654\

25278625518184175746728909777727938000816470600161452491921732172147\

72350141441973568548161361157352552133475741849468438523323907394143\

33454776241686251898356948556209921922218427255025425688767179049460\

16534668049886272327917860857843838279679766814541009538837863609506\

80064225125205117392984896084128488626945604241965285022210661186306\

74427862203919494504712371378696095636437191728746776465757396241389\

08658326459958133904780275900994657640789512694683983525957098258226\

20522489407726719478268482601476990902640136394437455305068203496252\

45174939965143142980919065925093722169646151570985838741059788595977\

29754989301617539284681382686838689427741559918559252459539594310499\

72524680845987273644695848653836736222626099124608051243884390451244\

13654976278079771569143599770012961608944169486855584840635342207222\

58284886481584560285060168427394522674676788952521385225499546667278\

23986456596116354886230577456498035593634568174324112515076069479451\

09659609402522887971089314566913686722874894056010150330861803525349\

26405628141238318057841705943332758574332598984034941906987190827077\

78800563758907673598476565621751899342141739174608536976010500429544\

97914338686005220001118337811537535870789868205242501742119954572926\

08064019121534445832223871740804021266231732623804857897893758410276\

80559945431249738788098122178065613023460584971431268589190517059713\

67863658649235616898022141439995178702171967255934705944461122300191\

90990455052113690089428986937772941114299875352687256660055151501910\

54346484571790828311777320064106726911789402925046658825360900699498\

13994630511319896853532683576397453722524094333445752903347457486116\

56180135385407154091144214138926043317519187658409887995199042154820\

48173429009289164300666940617887974638071838048285283400579134427776\

98653733578044176161109901553630618717787629360779214689171053712516\

96929836257877364490328364198608093871458118755467347458876405019869\

11929291294012540560547332296750954390786729279541567813892854365257\

29151266324244440556283675140992156028932206981841774602730900394251\

59699186402299448655083422333798805241201274009459824213749144064263\

24489250353097554920216784857439753855497782648375705981096229721754\

94653400999334164779071210944998864849639156407738084592128739301262\

80146173294769187759015682182164919839790068544987515285454332066009\

47315986064707992687849816296670792238300216036771993992803359199137\

14331578921792615398889450399932747782702046214229340638918949391305\

18148298772166781212391812329897763327254570792248296643866198603586\

62675195552286003897639317060203299203706915854949865635518902086448\

47680385643256427478288559990747813345217638828123563106667390102754\

35984409455178091680914182328186605852932017926161320529095568019114\

31815752162247892379522784601586154927670965143633603889864422975538\

75329415490314629253906659163341871756174888293989666972790036850458\

43702350714544039956776343319091037384740355470681308218077567401473\

60664591730485540712428920582857383456320165658299216270513576504396\

00001617189004469989562122396366336201363073406137497078282821316959\

64283624203463330458244959835820009740206643159841554384966975713601\

68087932837219256005381812239006045628780574357697884991369708541707\

32214885500425421614141409669426291276174291204776085839437651584269\

19673715480185947785069603147832366015787718450203282895945841275266\

07059870062232755603634700698595476406849071291561266671434287786971\

65825847993825298354061509667094723200


real	5m44.403s

user	5m44.474s

sys	0m0.012s

Hardware

  • Sun UltraSparc T1 (Niagara) CPU clocked at 1.0 GHz
  • 8 GB of RAM

    Kernel

    • Debian 3.2.39-2 sparc64 (SMP)

Share this post


Link to post
Share on other sites

Posted


3.141592653589793238462643383279502884197169399375105820974944592307\

81640628620899862803482534211706798214808651328230664709384460955058\

22317253594081284811174502841027019385211055596446229489549303819644\

28810975665933446128475648233786783165271201909145648566923460348610\

45432664821339360726024914127372458700660631558817488152092096282925\

40917153643678925903600113305305488204665213841469519415116094330572\

70365759591953092186117381932611793105118548074462379962749567351885\

75272489122793818301194912983367336244065664308602139494639522473719\

07021798609437027705392171762931767523846748184676694051320005681271\

45263560827785771342757789609173637178721468440901224953430146549585\

37105079227968925892354201995611212902196086403441815981362977477130\

99605187072113499999983729780499510597317328160963185950244594553469\

08302642522308253344685035261931188171010003137838752886587533208381\

42061717766914730359825349042875546873115956286388235378759375195778\

18577805321712268066130019278766111959092164201989380952572010654858\

63278865936153381827968230301952035301852968995773622599413891249721\

77528347913151557485724245415069595082953311686172785588907509838175\

46374649393192550604009277016711390098488240128583616035637076601047\

10181942955596198946767837449448255379774726847104047534646208046684\

25906949129331367702898915210475216205696602405803815019351125338243\

00355876402474964732639141992726042699227967823547816360093417216412\

19924586315030286182974555706749838505494588586926995690927210797509\

30295532116534498720275596023648066549911988183479775356636980742654\

25278625518184175746728909777727938000816470600161452491921732172147\

72350141441973568548161361157352552133475741849468438523323907394143\

33454776241686251898356948556209921922218427255025425688767179049460\

16534668049886272327917860857843838279679766814541009538837863609506\

80064225125205117392984896084128488626945604241965285022210661186306\

74427862203919494504712371378696095636437191728746776465757396241389\

08658326459958133904780275900994657640789512694683983525957098258226\

20522489407726719478268482601476990902640136394437455305068203496252\

45174939965143142980919065925093722169646151570985838741059788595977\

29754989301617539284681382686838689427741559918559252459539594310499\

72524680845987273644695848653836736222626099124608051243884390451244\

13654976278079771569143599770012961608944169486855584840635342207222\

58284886481584560285060168427394522674676788952521385225499546667278\

23986456596116354886230577456498035593634568174324112515076069479451\

09659609402522887971089314566913686722874894056010150330861792868092\

08747609178249385890097149096759852613655497818931297848216829989487\

22658804857564014270477555132379641451523746234364542858444795265867\

82105114135473573952311342716610213596953623144295248493718711014576\

54035902799344037420073105785390621983874478084784896833214457138687\

51943506430218453191048481005370614680674919278191197939952061419663\

42875444064374512371819217999839101591956181467514269123974894090718\

64942319615679452080951465502252316038819301420937621378559566389377\

87083039069792077346722182562599661501421503068038447734549202605414\

66592520149744285073251866600213243408819071048633173464965145390579\

62685610055081066587969981635747363840525714591028970641401109712062\

80439039759515677157700420337869936007230558763176359421873125147120\

53292819182618612586732157919841484882916447060957527069572209175671\

16722910981690915280173506712748583222871835209353965725121083579151\

36988209144421006751033467110314126711136990865851639831501970165151\

16851714376576183515565088490998985998238734552833163550764791853589\

32261854896321329330898570642046752590709154814165498594616371802709\

81994309924488957571282890592323326097299712084433573265489382391193\

25974636673058360414281388303203824903758985243744170291327656180937\

73444030707469211201913020330380197621101100449293215160842444859637\

66983895228684783123552658213144957685726243344189303968642624341077\

32269780280731891544110104468232527162010526522721116603966655730925\

47110557853763466820653109896526918620564769312570586356620185581007\

29360659876486117910453348850346113657686753249441668039626579787718\

55608455296541266540853061434443185867697514566140680070023787765913\

44017127494704205622305389945613140711270004078547332699390814546646\

45880797270826683063432858785698305235808933065757406795457163775254\

20211495576158140025012622859413021647155097925923099079654737612551\

76567513575178296664547791745011299614890304639947132962107340437518\

95735961458901938971311179042978285647503203198691514028708085990480\

10941214722131794764777262241425485454033215718530614228813758504306\

33217518297986622371721591607716692547487389866549494501146540628433\

66393790039769265672146385306736096571209180763832716641627488880078\

69256029022847210403172118608204190004229661711963779213375751149595\

01566049631862947265473642523081770367515906735023507283540567040386\

74351362222477158915049530984448933309634087807693259939780541934144\

73774418426312986080998886874132604720


real    0m33.375s

user    0m33.369s

sys    0m0.001s

Hardware

  • Intel Core 2 Quad CPU Q6600 clocked at 2.40 GHz
  • 8 GB of RAM

    Kernel

    • 2.6.32-358.2.1.el6.x86_64 (SMP)

Share this post


Link to post
Share on other sites

Posted

"real 0m33.296s

user 0m33.268s

sys 0m0.012s"

(hack)Mac, Q6700, 6GB DDR2 RAM

"real 0m30.680s

user 0m30.627s

sys 0m0.003s"

Arch VM on ESXi server, 8 cores of 16 allowed from dual E5620, 4GB DDR3 RAM

Share this post


Link to post
Share on other sites

Posted

Pi is 1.34~

Are you insane?? :woot::wacko::rofl:

2 people like this

Share this post


Link to post
Share on other sites

Posted

Hardware: Intel

Share this post


Link to post
Share on other sites

Posted

5 minutes and 44 seconds seems nigh unbeatable based on everyone else's times (including my own). I THINK I'M GOING TO WIN!

Too bad I don't have a working hard drive for my PowerBook G4 anymore. Maybe that machine would take even longer to compute Pi to 5000 decimal places and multiply it by four! I really want to try it now...

Share this post


Link to post
Share on other sites

Posted

Intel

Share this post


Link to post
Share on other sites

Posted

Pi is 1.34~

wait what? not it isnt its 3.14........

Is that the number pi?

yep that is pi expanded out

Share this post


Link to post
Share on other sites

Posted

I am also interested in knowing what, specifically, you are testing. Which compiler options are you enabling/disabling? Which compiler are you using? Which distribution are you compiling the kernel on? How are you compiling the kernel (using kbuild, Debian kernel build scripts, or something else)? Are you using the mainline kernel, a stable kernel, a specific distro kernel, or something else?

Off Topic: ChuckFinley, I really like your user name! I'm a fan of that show too. I've watched all the episodes they have on Netflix. I'll probably have to buy it outright at some point.

Share this post


Link to post
Share on other sites

Posted

wait what? not it isnt its 3.14........

I had a very bad headache at that time. My head's not always thinking logically... :|

1 person likes this

Share this post


Link to post
Share on other sites

Posted

I had a very bad headache at that time. My head's not always thinking logically... :|

Its okay. You're not the only one who made a mistake. I stated that it is "Pi to 5000 decimal places [multiplied] by four", but that's not actually true. The command is just timing how long it takes for bc to compute Pi (to 5000 decimals of precision).

Share this post


Link to post
Share on other sites

Posted

Intel

Share this post


Link to post
Share on other sites

Posted

unless it says sudo, you won't do that much...

I have an i5 3570K (no OC yet), and ASRock Extreme 3

stupid thing to say, I would rather have a command break my system (which can be reinstalled) than some command erasing all my personal files and work that I had done that day.

Share this post


Link to post
Share on other sites

Posted

real 0m20.158s

user 0m20.149s

sys 0m0.007s

MBPr

2.6 GHz Intel Core i7

Share this post


Link to post
Share on other sites

Posted

Calculating Pi on the (Raspberry) Pi:

real 4m4.804s

user 4m3.870s

sys 0m0.140s

Share this post


Link to post
Share on other sites

Posted

...snip...

65825847993825298354061509667094723200

[b]Hardware[/b]

  • Sun UltraSparc T1 (Niagara) CPU clocked at 1.0 GHz
  • 8 GB of RAM
    [/list]
    [b]Kernel[/b]
    • Debian 3.2.39-2 sparc64 (SMP)
      [/list]


[code]
...snip...
73774418426312986080998886874132604720

[b]Hardware[/b]

[list]Intel Core 2 Quad CPU Q6600 clocked at 2.40 GHz
8 GB of RAM

[b]Kernel[/b][list]

[*]2.6.32-358.2.1.el6.x86_64 (SMP)

Why do you get different results in your Sun system? Which one is flawed?

Share this post


Link to post
Share on other sites

Posted

Thanks for these guys, Looks like we have a healthy discussion going. Yeah why does the SPARC get a different result and also take over 5mins to do it. It looks like the i7's are the winners. I got mine to a 22sec. I am trying the latest bleeding edge mainline kernel with the i7 gcc optimizations.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.