"9,999 digits of PHI with strings" Benchmark - Sanmayce - 12-26-2024
Using Fibonacci numbers and my QB string arithmetic library here comes one single-threaded integer benchmark.
Using the superb 'perf' on Linux, the Giga-Instructions-Per-Second come as a good metric how well your CPU crunches bytes (the string arithmetic has byte granularity).
Code: (Select All) ' Compiled with "-O3 -ffast-math -msse4.2 -maes" and QB64PE v.3.9.1: 1,113,601,418,668 instructions / 331 seconds = 3,364,354,739 IPS = 3.3 GIPS on i3-7100U CPU @ 2.40GHz
'[sanmayce@leprechaun2 _KAZE_SSD_960_GiB_2024-Dec-17]$ perf stat -d ./PHI
'Summing F( 23925 )...
'F( 3 )=3
'F( 4 )=5
'F( 5 )=8
'...
'F( 23924 )=47841851487491717188369950777298669167663342266874693999118208244938958398625421296797461022660291663086469076970499854077348076427147067882326983665708515025547268412857009845909353486886470235446908084360161947388570165882286894744080682962274924753800904124208034857257196895622922538459359899805898297526656444631792883797221582556946305731341401226167824753694299792625705690845967957346428762327837426797250717582982715993962395746400189036759066690520210001741669410305273868407233117520054935141072553934024950683334016163730673950771510373067371525873132357455876578498518263744741737241521702420935885152114049483589733449720901542802668092938337829866737819465879046609370957633361290586166821204193090797247398622462427612345202496030582035269591979640818489394948569539752109783104500587734752737290983885401286510106729336261349287029386862785265595070194069483082706773902025479933792429543609490429724756545264517711210676138054847844195710597820849100762338255876100604729655835586918235223235862902220411260314978269776995120892506020666653831131802506263739864406968845024615728163689191064579128892012210776352552628547232390117020156705861585640146349053234332685353535670748870410616203104509964053335491084948645572243911838682907087736115700360723903639274460764994281168662596292732128672528214400107205686330222698032965500798632556507070139640981749604635257352747126019275814174161510604379314032555703916144242840817248252243471498670187819730323563099846880954597267128496939303663185731835738416604478079269358787169152645767357673366441789205498481237180113504089884073930092599828053712188674380188936214231303934173144349426966009049647870760998104566731859510926825808041902049048831111092065632132730618041078692999733158076588959907588482771977975229565913278917907551814211440268025707624753362611435126996655210377816920002180075620420987664887516200157955032957824081793688317874868017541484966870977094777140053959818382226295099679304401986039249233311596462699692943886366288869355182601089300431620297164907200963476539782215022725974729660493577596536230636635203629566403062511864514079596944642235769883303543763512559012677049578578405318912677484267450130494920388472524089080447705614758644676364183252872405297755939217948530967200086985611018508468696219267713804945229884786509073554004958286893323840123563966155398727717488820722358965654315183620698232378498884570854463930736580126375589514095027434401966034747273393440269906256476869613463808632710020497739260337159484529366532679424437853401794705781189453045574261516839142771135364780107939228961528415201864617764563783443146286847054293695298689399632897123300242780106716966269696566069234261417390575151791205119631224378372621737272151148196096676134183567710994832007997287992520737501425432495170088214865375430148855161741775249778569726437327057350160319777243963695962181647791766005971556137787087727999574560038353886995482720343915735994718669707383514665220684643642455425025238981689721756095407324568923230414091011947999079626721229330168249482129144353021264938829311994403121093606303301565916181435206725667075723909619146455053612996443151089856744822598161353703959736103390526184965496156021875374579914579983635871130709459908105307232876457574551352533711117656594273847420955638670494169497355120826074281816102867648961551931214068843304182381034557274566927218096432847624998447536224446444125953737402823091102830624017748444668862077718356137103330063512207623793757269707472573105618937351115473887009389173692164325075820969695821965167414080073722213371615566991969684851341700225515018617603075107331997100556505339750489563172403520006243489082554198653507987862013162509398214479570286806069362514255547905135811407873177034254314944204822774242139024274465468998066980111279082983804629370310987883535731336260677903173453593648288542388527112553978225155514222616384350207184117942212260190821437828227680119795186580895427216878157845096484703970872434228011801609332414854898575971315561448537235389610691716070811674706825557656847487990114419098684962665716323483525525423466559362630611465315796947196946303653885634133218648178823197504658310543951408370951329956783239613618236467624280032948142508817639006033688095560531270275513967805109185385498368606172049475093578313791560681251853617070850262698969752764955678669960929101586967648405374753139051060701644883354617366752751568641160403931709477547956816924304443913531809134600637406927706377058266388689849286018031130979641324141142482044960966175080657313374897665669410724459514351339143411095805641269244119710045573168111655381042843686177702213378052863477450203621788529094766953042094919836883057315607288472605180560996531151894131530235507584796797193517123037141106462397323032242606965812293237579506030421268834952537947416898708494557813880415789945219116532313140502141906040225932717884777318279352111707922592605969458704005055229946701827817332980728477060975002050
'F( 23925 )=77409741791486313238305366783804862693289860877027181652758050902109333587377323762073911031810343137261998679084081961075731037274059647257087548350100361515377797342670602412625337446315186274930311858109088298313037316396257849508993268501315909871931580399939548473573738520631682413050942026712969517221651682506611295228624453142412041724685167507967294757223396660175246954283134383743997854885491242045244459139492289747625228620399499340110634815130140392957486967992386567324587312323581416931850795675640399448858245347452138244115742679785967584014000765154079399013373194366014209228490020883889818310144106167581876784636830780740732933649370761153766990664904189313261671667583912406048010527098156720245027558284759492177884520136087797412506169010338654215046872906026341168281517852180965098599931724206321639067275868679531799477931561105339304458255908293272558931578089794121879540234461963130852902234209502929426927480200308026888250124427009134399282861644142764368236388149739640958562184682505742896569690823465146789203169837258585568540998195530665029954594511658426757099149555694499468814948323285313155600491477859659252185153631325800627453475432972618012778477882047286793479613859186954165661245762459928224004843551732487785067968624493569977880869710817417967115622449174619536259637497422825703498397847472603416526550878916545635216077004076493510687215608637847422473073561498077182922927122272935155858321749799422133425598890547221760228741626399981316632512846304376104517012408089858638507270826101069674584737773093823436010183789187807399793967877702852359702634388578540582966414808576811037825509265000256248133695596241428047075681172634972066443527614199836560376501312593342908780958481187745638512133656398458806239298421824283963625048260914635667504018811305902822319771631511993112766429855097779478223291891216932246979769019981539114821473271267634633820327863972249740674873032949194313331564202817830952532314045841655402960115759434222663401208713978884917099725851758530717522966249787499126607408642576295978641925042874729271726522421175611145437438345866343029811675008099910727485170792033500413027684951368495864555295823986193489957871811733285791407915290506015954112090865578575555017701346881231132773666033230353625425532203805489220901738106728050612464403239945525160438735315389189222959303247713687987461423099316632993429371401784462447000246418531183195303954291392832140817803856368931839772691073607210301431695579315809362365146284579056348682693930231732570185214723982167141785519125306322203100516361756483827225452475315870300514990687511348616088347531053011952536480081945146633452530876904841433252411572377371216450424511599097070911989244360436777138040653040396342792483769567187999474033913311730644475576403482145914961254069395118609215796441153033858696306341975196362710191884678730675992047765027898864428351658102858240299617656867549472964517302197206081450274885644861419674031579983935780151329873704783529030587031301369178516635997820669396360887280882603644296190468522991191491676429030872291725263552973636018294314177646331136074783821555546735579524926672373610433613030075153733123721950759928916566024618798166095077347988624596692213734139387020179502282128859655550061585411101926850427397120883005962077795963971696735208331370075290470279741935141780460327454512210753304698517827025368425897240865768510008741070643245575044325914689445422570787103964533328433134280633885201400585911163887744396924211795468476663566486086472353183086510227750377671835906337367358046393012319818846629296265281165838045043404126492505704974533589527906393896219795761701455425921738304739947741679611661884769447196660440301460273871822327055402004704004521779288795592485045404145123790669375730941311181163645280490119074415991574285941205861597513637090039021236176110859257836968122789551618365681665542167084533837377393217777036041952301697971123647163181823828752887394237029815057904446279777128507507941183906782989686826280966540028493569797490176112521667742132581214060212415368827546383694895157612415407827078222958605052882628096344974261336252249091505950149835417319446528174231271786621856756662666290772743335814473457102045342791615286725568278005373436873362943725561481745812459276903335060251818411588694368340552044773089504498297111075313377864043868979541102920012400334983298985189051199367890809761118580497536475047869883909031874411369036379999760539640454299490890928795472075894437752906431935916429524734411102946038786813454785217940667374431741414180962336129774200611940179855643427924601195490948469084595770230108113495641571685943999854033903662651666166328930579699067941056501305570393531710153787453493205281782591419367649981107238922425905965196500687442075999310024291428472429350303661399767674906951952140915603963584970915351695921759838333103297005019256559231156431838894327446369561661223010005467643861167293585409444768324974339631618431133701583343
'Dividing F(n)/F(n-1) with 10000 digits...
'Done in 331 seconds.
' Performance counter stats for './PHI':
' 334,777.37 msec task-clock:u # 1.011 CPUs utilized
' 0 context-switches:u # 0.000 /sec
' 0 cpu-migrations:u # 0.000 /sec
' 1,304 page-faults:u # 3.895 /sec
' 758,876,968,178 cycles:u # 2.267 GHz (50.01%)
' 1,113,601,418,668 instructions:u # 1.47 insn per cycle (62.52%)
' 224,592,815,264 branches:u # 670.872 M/sec (62.50%)
' 934,874,948 branch-misses:u # 0.42% of all branches (62.49%)
' 301,057,542,993 L1-dcache-loads:u # 899.277 M/sec (62.51%)
' 22,424,233,784 L1-dcache-load-misses:u # 7.45% of all L1-dcache accesses (62.50%)
' 165,841,357 LLC-loads:u # 495.378 K/sec (50.00%)
' 29,272,515 LLC-load-misses:u # 17.65% of all LL-cache accesses (50.00%)
' 331.064833595 seconds time elapsed
' 318.113223000 seconds user
' 8.819872000 seconds sys
'[sanmayce@leprechaun2 _KAZE_SSD_960_GiB_2024-Dec-17]$ head -c 10002 Phi-To-100000-Places.txt | cmp - <( head -c 10002 PHI.txt)
'- /dev/fd/63 differ: byte 10002, line 1
'[sanmayce@leprechaun2 _KAZE_SSD_960_GiB_2024-Dec-17]$ head -c 10001 Phi-To-100000-Places.txt | cmp - <( head -c 10001 PHI.txt)
'[sanmayce@leprechaun2 _KAZE_SSD_960_GiB_2024-Dec-17]$ lscpu
' Model name: Intel(R) Core(TM) i3-7100U CPU @ 2.40GHz
' Thread(s) per core: 2
' Core(s) per socket: 2
' Socket(s): 1
' CPU max MHz: 2400.0000
' CPU min MHz: 400.0000
'Caches (sum of all):
' L1d: 64 KiB (2 instances)
' L1i: 64 KiB (2 instances)
' L2: 512 KiB (2 instances)
' L3: 3 MiB (1 instance)
'[sanmayce@leprechaun2 _KAZE_SSD_960_GiB_2024-Dec-17]$
My main laptop scores 3.3 GIPS, guess 10 GIPS is the bare minimum for a modern CPU.
Wanted to see how my fastest ThinkPad (Whiskey Lake i7-8565U) crunches:
Only 9.4 GIPS, expected more.
RE: "9,999 digits of PHI with strings" Benchmark - Pete - 12-26-2024
Nothing like posting some good ASCII on the boards!
Pete
RE: "9,999 digits of PHI with strings" Benchmark - Jack - 12-27-2024
hello Sanmayce
I commented the line that prints the Fibonacci numbers because printing can be quite slow and it distorts the timing of the computations, it took a total of 83 seconds on my PC
RE: "9,999 digits of PHI with strings" Benchmark - ahenry3068 - 12-27-2024
(12-26-2024, 10:27 PM)Sanmayce Wrote: Using Fibonacci numbers and my QB string arithmetic library here comes one single-threaded integer benchmark.
Using the superb 'perf' on Linux, the Giga-Instructions-Per-Second come as a good metric how well your CPU crunches bytes (the string arithmetic has byte granularity).
Code: (Select All) ' Compiled with "-O3 -ffast-math -msse4.2 -maes" and QB64PE v.3.9.1: 1,113,601,418,668 instructions / 331 seconds = 3,364,354,739 IPS = 3.3 GIPS on i3-7100U CPU @ 2.40GHz
'[sanmayce@leprechaun2 _KAZE_SSD_960_GiB_2024-Dec-17]$ perf stat -d ./PHI
'Summing F( 23925 )...
'F( 3 )=3
'F( 4 )=5
'F( 5 )=8
'...
'F( 23924 )=47841851487491717188369950777298669167663342266874693999118208244938958398625421296797461022660291663086469076970499854077348076427147067882326983665708515025547268412857009845909353486886470235446908084360161947388570165882286894744080682962274924753800904124208034857257196895622922538459359899805898297526656444631792883797221582556946305731341401226167824753694299792625705690845967957346428762327837426797250717582982715993962395746400189036759066690520210001741669410305273868407233117520054935141072553934024950683334016163730673950771510373067371525873132357455876578498518263744741737241521702420935885152114049483589733449720901542802668092938337829866737819465879046609370957633361290586166821204193090797247398622462427612345202496030582035269591979640818489394948569539752109783104500587734752737290983885401286510106729336261349287029386862785265595070194069483082706773902025479933792429543609490429724756545264517711210676138054847844195710597820849100762338255876100604729655835586918235223235862902220411260314978269776995120892506020666653831131802506263739864406968845024615728163689191064579128892012210776352552628547232390117020156705861585640146349053234332685353535670748870410616203104509964053335491084948645572243911838682907087736115700360723903639274460764994281168662596292732128672528214400107205686330222698032965500798632556507070139640981749604635257352747126019275814174161510604379314032555703916144242840817248252243471498670187819730323563099846880954597267128496939303663185731835738416604478079269358787169152645767357673366441789205498481237180113504089884073930092599828053712188674380188936214231303934173144349426966009049647870760998104566731859510926825808041902049048831111092065632132730618041078692999733158076588959907588482771977975229565913278917907551814211440268025707624753362611435126996655210377816920002180075620420987664887516200157955032957824081793688317874868017541484966870977094777140053959818382226295099679304401986039249233311596462699692943886366288869355182601089300431620297164907200963476539782215022725974729660493577596536230636635203629566403062511864514079596944642235769883303543763512559012677049578578405318912677484267450130494920388472524089080447705614758644676364183252872405297755939217948530967200086985611018508468696219267713804945229884786509073554004958286893323840123563966155398727717488820722358965654315183620698232378498884570854463930736580126375589514095027434401966034747273393440269906256476869613463808632710020497739260337159484529366532679424437853401794705781189453045574261516839142771135364780107939228961528415201864617764563783443146286847054293695298689399632897123300242780106716966269696566069234261417390575151791205119631224378372621737272151148196096676134183567710994832007997287992520737501425432495170088214865375430148855161741775249778569726437327057350160319777243963695962181647791766005971556137787087727999574560038353886995482720343915735994718669707383514665220684643642455425025238981689721756095407324568923230414091011947999079626721229330168249482129144353021264938829311994403121093606303301565916181435206725667075723909619146455053612996443151089856744822598161353703959736103390526184965496156021875374579914579983635871130709459908105307232876457574551352533711117656594273847420955638670494169497355120826074281816102867648961551931214068843304182381034557274566927218096432847624998447536224446444125953737402823091102830624017748444668862077718356137103330063512207623793757269707472573105618937351115473887009389173692164325075820969695821965167414080073722213371615566991969684851341700225515018617603075107331997100556505339750489563172403520006243489082554198653507987862013162509398214479570286806069362514255547905135811407873177034254314944204822774242139024274465468998066980111279082983804629370310987883535731336260677903173453593648288542388527112553978225155514222616384350207184117942212260190821437828227680119795186580895427216878157845096484703970872434228011801609332414854898575971315561448537235389610691716070811674706825557656847487990114419098684962665716323483525525423466559362630611465315796947196946303653885634133218648178823197504658310543951408370951329956783239613618236467624280032948142508817639006033688095560531270275513967805109185385498368606172049475093578313791560681251853617070850262698969752764955678669960929101586967648405374753139051060701644883354617366752751568641160403931709477547956816924304443913531809134600637406927706377058266388689849286018031130979641324141142482044960966175080657313374897665669410724459514351339143411095805641269244119710045573168111655381042843686177702213378052863477450203621788529094766953042094919836883057315607288472605180560996531151894131530235507584796797193517123037141106462397323032242606965812293237579506030421268834952537947416898708494557813880415789945219116532313140502141906040225932717884777318279352111707922592605969458704005055229946701827817332980728477060975002050
'F( 23925 )=77409741791486313238305366783804862693289860877027181652758050902109333587377323762073911031810343137261998679084081961075731037274059647257087548350100361515377797342670602412625337446315186274930311858109088298313037316396257849508993268501315909871931580399939548473573738520631682413050942026712969517221651682506611295228624453142412041724685167507967294757223396660175246954283134383743997854885491242045244459139492289747625228620399499340110634815130140392957486967992386567324587312323581416931850795675640399448858245347452138244115742679785967584014000765154079399013373194366014209228490020883889818310144106167581876784636830780740732933649370761153766990664904189313261671667583912406048010527098156720245027558284759492177884520136087797412506169010338654215046872906026341168281517852180965098599931724206321639067275868679531799477931561105339304458255908293272558931578089794121879540234461963130852902234209502929426927480200308026888250124427009134399282861644142764368236388149739640958562184682505742896569690823465146789203169837258585568540998195530665029954594511658426757099149555694499468814948323285313155600491477859659252185153631325800627453475432972618012778477882047286793479613859186954165661245762459928224004843551732487785067968624493569977880869710817417967115622449174619536259637497422825703498397847472603416526550878916545635216077004076493510687215608637847422473073561498077182922927122272935155858321749799422133425598890547221760228741626399981316632512846304376104517012408089858638507270826101069674584737773093823436010183789187807399793967877702852359702634388578540582966414808576811037825509265000256248133695596241428047075681172634972066443527614199836560376501312593342908780958481187745638512133656398458806239298421824283963625048260914635667504018811305902822319771631511993112766429855097779478223291891216932246979769019981539114821473271267634633820327863972249740674873032949194313331564202817830952532314045841655402960115759434222663401208713978884917099725851758530717522966249787499126607408642576295978641925042874729271726522421175611145437438345866343029811675008099910727485170792033500413027684951368495864555295823986193489957871811733285791407915290506015954112090865578575555017701346881231132773666033230353625425532203805489220901738106728050612464403239945525160438735315389189222959303247713687987461423099316632993429371401784462447000246418531183195303954291392832140817803856368931839772691073607210301431695579315809362365146284579056348682693930231732570185214723982167141785519125306322203100516361756483827225452475315870300514990687511348616088347531053011952536480081945146633452530876904841433252411572377371216450424511599097070911989244360436777138040653040396342792483769567187999474033913311730644475576403482145914961254069395118609215796441153033858696306341975196362710191884678730675992047765027898864428351658102858240299617656867549472964517302197206081450274885644861419674031579983935780151329873704783529030587031301369178516635997820669396360887280882603644296190468522991191491676429030872291725263552973636018294314177646331136074783821555546735579524926672373610433613030075153733123721950759928916566024618798166095077347988624596692213734139387020179502282128859655550061585411101926850427397120883005962077795963971696735208331370075290470279741935141780460327454512210753304698517827025368425897240865768510008741070643245575044325914689445422570787103964533328433134280633885201400585911163887744396924211795468476663566486086472353183086510227750377671835906337367358046393012319818846629296265281165838045043404126492505704974533589527906393896219795761701455425921738304739947741679611661884769447196660440301460273871822327055402004704004521779288795592485045404145123790669375730941311181163645280490119074415991574285941205861597513637090039021236176110859257836968122789551618365681665542167084533837377393217777036041952301697971123647163181823828752887394237029815057904446279777128507507941183906782989686826280966540028493569797490176112521667742132581214060212415368827546383694895157612415407827078222958605052882628096344974261336252249091505950149835417319446528174231271786621856756662666290772743335814473457102045342791615286725568278005373436873362943725561481745812459276903335060251818411588694368340552044773089504498297111075313377864043868979541102920012400334983298985189051199367890809761118580497536475047869883909031874411369036379999760539640454299490890928795472075894437752906431935916429524734411102946038786813454785217940667374431741414180962336129774200611940179855643427924601195490948469084595770230108113495641571685943999854033903662651666166328930579699067941056501305570393531710153787453493205281782591419367649981107238922425905965196500687442075999310024291428472429350303661399767674906951952140915603963584970915351695921759838333103297005019256559231156431838894327446369561661223010005467643861167293585409444768324974339631618431133701583343
'Dividing F(n)/F(n-1) with 10000 digits...
'Done in 331 seconds.
' Performance counter stats for './PHI':
' 334,777.37 msec task-clock:u # 1.011 CPUs utilized
' 0 context-switches:u # 0.000 /sec
' 0 cpu-migrations:u # 0.000 /sec
' 1,304 page-faults:u # 3.895 /sec
' 758,876,968,178 cycles:u # 2.267 GHz (50.01%)
' 1,113,601,418,668 instructions:u # 1.47 insn per cycle (62.52%)
' 224,592,815,264 branches:u # 670.872 M/sec (62.50%)
' 934,874,948 branch-misses:u # 0.42% of all branches (62.49%)
' 301,057,542,993 L1-dcache-loads:u # 899.277 M/sec (62.51%)
' 22,424,233,784 L1-dcache-load-misses:u # 7.45% of all L1-dcache accesses (62.50%)
' 165,841,357 LLC-loads:u # 495.378 K/sec (50.00%)
' 29,272,515 LLC-load-misses:u # 17.65% of all LL-cache accesses (50.00%)
' 331.064833595 seconds time elapsed
' 318.113223000 seconds user
' 8.819872000 seconds sys
'[sanmayce@leprechaun2 _KAZE_SSD_960_GiB_2024-Dec-17]$ head -c 10002 Phi-To-100000-Places.txt | cmp - <( head -c 10002 PHI.txt)
'- /dev/fd/63 differ: byte 10002, line 1
'[sanmayce@leprechaun2 _KAZE_SSD_960_GiB_2024-Dec-17]$ head -c 10001 Phi-To-100000-Places.txt | cmp - <( head -c 10001 PHI.txt)
'[sanmayce@leprechaun2 _KAZE_SSD_960_GiB_2024-Dec-17]$ lscpu
' Model name: Intel(R) Core(TM) i3-7100U CPU @ 2.40GHz
' Thread(s) per core: 2
' Core(s) per socket: 2
' Socket(s): 1
' CPU max MHz: 2400.0000
' CPU min MHz: 400.0000
'Caches (sum of all):
' L1d: 64 KiB (2 instances)
' L1i: 64 KiB (2 instances)
' L2: 512 KiB (2 instances)
' L3: 3 MiB (1 instance)
'[sanmayce@leprechaun2 _KAZE_SSD_960_GiB_2024-Dec-17]$
My main laptop scores 3.3 GIPS, guess 10 GIPS is the bare minimum for a modern CPU.
Wanted to see how my fastest ThinkPad (Whiskey Lake i7-8565U) crunches:
Only 9.4 GIPS, expected more.
This is my output
Where do the performance stats come from ?
RE: "9,999 digits of PHI with strings" Benchmark - Sanmayce - 12-27-2024
(12-26-2024, 11:45 PM)Pete Wrote: Nothing like posting some good ASCII on the boards!
Pete ASCII forever! Yet, this time one of my descriptions given to Japanese AI text-to-image generator.
(Yesterday, 12:12 AM)Jack Wrote: hello Sanmayce
I commented the line that prints the Fibonacci numbers because printing can be quite slow and it distorts the timing of the computations, it took a total of 83 seconds on my PC Hi Jack,
you are right, but the dumping is intentional, if you have (like I) a big Console window then you can see a "filling up" effect as length of F(n) is increasing. In order to bypass the slow console printing I use redirection to a file.
@ahenry3068
You have to install 'perf', this is a must-have for any serious benchmarking since it uses the hardware counters, once I asked the author of stats reporting in Valgrind about proper testing, the author himself told me that he uses software "simulated" counters, so 'perf' rules.
Also, you have to run it in maximum niceness aka priority, see the screenshot.
Let's see how one really fast laptop behaves (using my brother's ThinkPad P14s):
Better, AMD Zen4 crunches at 15.0 GIPS, I was right - anything below 10 is non-modern, ugh.
RE: "9,999 digits of PHI with strings" Benchmark - ahenry3068 - 12-27-2024
(Yesterday, 12:15 AM)ahenry3068 Wrote: (12-26-2024, 10:27 PM)Sanmayce Wrote: Using Fibonacci numbers and my QB string arithmetic library here comes one single-threaded integer benchmark.
Using the superb 'perf' on Linux, the Giga-Instructions-Per-Second come as a good metric how well your CPU crunches bytes (the string arithmetic has byte granularity).
Code: (Select All) ' Compiled with "-O3 -ffast-math -msse4.2 -maes" and QB64PE v.3.9.1: 1,113,601,418,668 instructions / 331 seconds = 3,364,354,739 IPS = 3.3 GIPS on i3-7100U CPU @ 2.40GHz
'[sanmayce@leprechaun2 _KAZE_SSD_960_GiB_2024-Dec-17]$ perf stat -d ./PHI
'Summing F( 23925 )...
'F( 3 )=3
'F( 4 )=5
'F( 5 )=8
'...
'F( 23924 )=47841851487491717188369950777298669167663342266874693999118208244938958398625421296797461022660291663086469076970499854077348076427147067882326983665708515025547268412857009845909353486886470235446908084360161947388570165882286894744080682962274924753800904124208034857257196895622922538459359899805898297526656444631792883797221582556946305731341401226167824753694299792625705690845967957346428762327837426797250717582982715993962395746400189036759066690520210001741669410305273868407233117520054935141072553934024950683334016163730673950771510373067371525873132357455876578498518263744741737241521702420935885152114049483589733449720901542802668092938337829866737819465879046609370957633361290586166821204193090797247398622462427612345202496030582035269591979640818489394948569539752109783104500587734752737290983885401286510106729336261349287029386862785265595070194069483082706773902025479933792429543609490429724756545264517711210676138054847844195710597820849100762338255876100604729655835586918235223235862902220411260314978269776995120892506020666653831131802506263739864406968845024615728163689191064579128892012210776352552628547232390117020156705861585640146349053234332685353535670748870410616203104509964053335491084948645572243911838682907087736115700360723903639274460764994281168662596292732128672528214400107205686330222698032965500798632556507070139640981749604635257352747126019275814174161510604379314032555703916144242840817248252243471498670187819730323563099846880954597267128496939303663185731835738416604478079269358787169152645767357673366441789205498481237180113504089884073930092599828053712188674380188936214231303934173144349426966009049647870760998104566731859510926825808041902049048831111092065632132730618041078692999733158076588959907588482771977975229565913278917907551814211440268025707624753362611435126996655210377816920002180075620420987664887516200157955032957824081793688317874868017541484966870977094777140053959818382226295099679304401986039249233311596462699692943886366288869355182601089300431620297164907200963476539782215022725974729660493577596536230636635203629566403062511864514079596944642235769883303543763512559012677049578578405318912677484267450130494920388472524089080447705614758644676364183252872405297755939217948530967200086985611018508468696219267713804945229884786509073554004958286893323840123563966155398727717488820722358965654315183620698232378498884570854463930736580126375589514095027434401966034747273393440269906256476869613463808632710020497739260337159484529366532679424437853401794705781189453045574261516839142771135364780107939228961528415201864617764563783443146286847054293695298689399632897123300242780106716966269696566069234261417390575151791205119631224378372621737272151148196096676134183567710994832007997287992520737501425432495170088214865375430148855161741775249778569726437327057350160319777243963695962181647791766005971556137787087727999574560038353886995482720343915735994718669707383514665220684643642455425025238981689721756095407324568923230414091011947999079626721229330168249482129144353021264938829311994403121093606303301565916181435206725667075723909619146455053612996443151089856744822598161353703959736103390526184965496156021875374579914579983635871130709459908105307232876457574551352533711117656594273847420955638670494169497355120826074281816102867648961551931214068843304182381034557274566927218096432847624998447536224446444125953737402823091102830624017748444668862077718356137103330063512207623793757269707472573105618937351115473887009389173692164325075820969695821965167414080073722213371615566991969684851341700225515018617603075107331997100556505339750489563172403520006243489082554198653507987862013162509398214479570286806069362514255547905135811407873177034254314944204822774242139024274465468998066980111279082983804629370310987883535731336260677903173453593648288542388527112553978225155514222616384350207184117942212260190821437828227680119795186580895427216878157845096484703970872434228011801609332414854898575971315561448537235389610691716070811674706825557656847487990114419098684962665716323483525525423466559362630611465315796947196946303653885634133218648178823197504658310543951408370951329956783239613618236467624280032948142508817639006033688095560531270275513967805109185385498368606172049475093578313791560681251853617070850262698969752764955678669960929101586967648405374753139051060701644883354617366752751568641160403931709477547956816924304443913531809134600637406927706377058266388689849286018031130979641324141142482044960966175080657313374897665669410724459514351339143411095805641269244119710045573168111655381042843686177702213378052863477450203621788529094766953042094919836883057315607288472605180560996531151894131530235507584796797193517123037141106462397323032242606965812293237579506030421268834952537947416898708494557813880415789945219116532313140502141906040225932717884777318279352111707922592605969458704005055229946701827817332980728477060975002050
'F( 23925 )=77409741791486313238305366783804862693289860877027181652758050902109333587377323762073911031810343137261998679084081961075731037274059647257087548350100361515377797342670602412625337446315186274930311858109088298313037316396257849508993268501315909871931580399939548473573738520631682413050942026712969517221651682506611295228624453142412041724685167507967294757223396660175246954283134383743997854885491242045244459139492289747625228620399499340110634815130140392957486967992386567324587312323581416931850795675640399448858245347452138244115742679785967584014000765154079399013373194366014209228490020883889818310144106167581876784636830780740732933649370761153766990664904189313261671667583912406048010527098156720245027558284759492177884520136087797412506169010338654215046872906026341168281517852180965098599931724206321639067275868679531799477931561105339304458255908293272558931578089794121879540234461963130852902234209502929426927480200308026888250124427009134399282861644142764368236388149739640958562184682505742896569690823465146789203169837258585568540998195530665029954594511658426757099149555694499468814948323285313155600491477859659252185153631325800627453475432972618012778477882047286793479613859186954165661245762459928224004843551732487785067968624493569977880869710817417967115622449174619536259637497422825703498397847472603416526550878916545635216077004076493510687215608637847422473073561498077182922927122272935155858321749799422133425598890547221760228741626399981316632512846304376104517012408089858638507270826101069674584737773093823436010183789187807399793967877702852359702634388578540582966414808576811037825509265000256248133695596241428047075681172634972066443527614199836560376501312593342908780958481187745638512133656398458806239298421824283963625048260914635667504018811305902822319771631511993112766429855097779478223291891216932246979769019981539114821473271267634633820327863972249740674873032949194313331564202817830952532314045841655402960115759434222663401208713978884917099725851758530717522966249787499126607408642576295978641925042874729271726522421175611145437438345866343029811675008099910727485170792033500413027684951368495864555295823986193489957871811733285791407915290506015954112090865578575555017701346881231132773666033230353625425532203805489220901738106728050612464403239945525160438735315389189222959303247713687987461423099316632993429371401784462447000246418531183195303954291392832140817803856368931839772691073607210301431695579315809362365146284579056348682693930231732570185214723982167141785519125306322203100516361756483827225452475315870300514990687511348616088347531053011952536480081945146633452530876904841433252411572377371216450424511599097070911989244360436777138040653040396342792483769567187999474033913311730644475576403482145914961254069395118609215796441153033858696306341975196362710191884678730675992047765027898864428351658102858240299617656867549472964517302197206081450274885644861419674031579983935780151329873704783529030587031301369178516635997820669396360887280882603644296190468522991191491676429030872291725263552973636018294314177646331136074783821555546735579524926672373610433613030075153733123721950759928916566024618798166095077347988624596692213734139387020179502282128859655550061585411101926850427397120883005962077795963971696735208331370075290470279741935141780460327454512210753304698517827025368425897240865768510008741070643245575044325914689445422570787103964533328433134280633885201400585911163887744396924211795468476663566486086472353183086510227750377671835906337367358046393012319818846629296265281165838045043404126492505704974533589527906393896219795761701455425921738304739947741679611661884769447196660440301460273871822327055402004704004521779288795592485045404145123790669375730941311181163645280490119074415991574285941205861597513637090039021236176110859257836968122789551618365681665542167084533837377393217777036041952301697971123647163181823828752887394237029815057904446279777128507507941183906782989686826280966540028493569797490176112521667742132581214060212415368827546383694895157612415407827078222958605052882628096344974261336252249091505950149835417319446528174231271786621856756662666290772743335814473457102045342791615286725568278005373436873362943725561481745812459276903335060251818411588694368340552044773089504498297111075313377864043868979541102920012400334983298985189051199367890809761118580497536475047869883909031874411369036379999760539640454299490890928795472075894437752906431935916429524734411102946038786813454785217940667374431741414180962336129774200611940179855643427924601195490948469084595770230108113495641571685943999854033903662651666166328930579699067941056501305570393531710153787453493205281782591419367649981107238922425905965196500687442075999310024291428472429350303661399767674906951952140915603963584970915351695921759838333103297005019256559231156431838894327446369561661223010005467643861167293585409444768324974339631618431133701583343
'Dividing F(n)/F(n-1) with 10000 digits...
'Done in 331 seconds.
' Performance counter stats for './PHI':
' 334,777.37 msec task-clock:u # 1.011 CPUs utilized
' 0 context-switches:u # 0.000 /sec
' 0 cpu-migrations:u # 0.000 /sec
' 1,304 page-faults:u # 3.895 /sec
' 758,876,968,178 cycles:u # 2.267 GHz (50.01%)
' 1,113,601,418,668 instructions:u # 1.47 insn per cycle (62.52%)
' 224,592,815,264 branches:u # 670.872 M/sec (62.50%)
' 934,874,948 branch-misses:u # 0.42% of all branches (62.49%)
' 301,057,542,993 L1-dcache-loads:u # 899.277 M/sec (62.51%)
' 22,424,233,784 L1-dcache-load-misses:u # 7.45% of all L1-dcache accesses (62.50%)
' 165,841,357 LLC-loads:u # 495.378 K/sec (50.00%)
' 29,272,515 LLC-load-misses:u # 17.65% of all LL-cache accesses (50.00%)
' 331.064833595 seconds time elapsed
' 318.113223000 seconds user
' 8.819872000 seconds sys
'[sanmayce@leprechaun2 _KAZE_SSD_960_GiB_2024-Dec-17]$ head -c 10002 Phi-To-100000-Places.txt | cmp - <( head -c 10002 PHI.txt)
'- /dev/fd/63 differ: byte 10002, line 1
'[sanmayce@leprechaun2 _KAZE_SSD_960_GiB_2024-Dec-17]$ head -c 10001 Phi-To-100000-Places.txt | cmp - <( head -c 10001 PHI.txt)
'[sanmayce@leprechaun2 _KAZE_SSD_960_GiB_2024-Dec-17]$ lscpu
' Model name: Intel(R) Core(TM) i3-7100U CPU @ 2.40GHz
' Thread(s) per core: 2
' Core(s) per socket: 2
' Socket(s): 1
' CPU max MHz: 2400.0000
' CPU min MHz: 400.0000
'Caches (sum of all):
' L1d: 64 KiB (2 instances)
' L1i: 64 KiB (2 instances)
' L2: 512 KiB (2 instances)
' L3: 3 MiB (1 instance)
'[sanmayce@leprechaun2 _KAZE_SSD_960_GiB_2024-Dec-17]$
My main laptop scores 3.3 GIPS, guess 10 GIPS is the bare minimum for a modern CPU.
Wanted to see how my fastest ThinkPad (Whiskey Lake i7-8565U) crunches:
Only 9.4 GIPS, expected more.
This is my output
Where do the performance stats come from ?
|