{"id":16543,"date":"2020-12-17T13:49:56","date_gmt":"2020-12-17T18:49:56","guid":{"rendered":"https:\/\/scruss.com\/blog\/?p=16543"},"modified":"2024-12-26T14:35:50","modified_gmt":"2024-12-26T19:35:50","slug":"bench64-a-new-basic-benchmark-index-for-8-bit-computers","status":"publish","type":"post","link":"https:\/\/scruss.com\/blog\/2020\/12\/17\/bench64-a-new-basic-benchmark-index-for-8-bit-computers\/","title":{"rendered":"bench64: a new BASIC benchmark index for 8-bit computers"},"content":{"rendered":"\n<p>Nobody asked for this. Nobody <em>needs<\/em> this. But here we are \u2026<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"384\" height=\"247\" src=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/12\/bench64-c64c.png\" alt=\"commodore 64 screen shot showing benchmark results:\nbasic bench index\n&gt;i good. ntsc c64=100\n\n1\/8 - for:\n 60 s; 674.5 \/s; i= 100\n2\/8 - goto:\n 60 s; 442.3 \/s; i= 100\n3\/8 - gosub:\n 60 s; 350.8 \/s; i= 100\n4\/8 - if:\n 60 s; 242.9 \/s; i= 100\n5\/8 - fn:\n 60 s; 60.7 \/s; i= 100\n6\/8 - maths:\n 60 s; 6.4 \/s; i= 100\n7\/8 - string:\n 60 s; 82.2 \/s; i= 100\n8\/8 - array:\n 60 s; 27.9 \/s; i= 100\n\noverall index= 100\n\n\nready.\n\n\" class=\"wp-image-16545\" srcset=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/12\/bench64-c64c.png 384w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/12\/bench64-c64c-320x206.png 320w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/12\/bench64-c64c-160x103.png 160w\" sizes=\"auto, (max-width: 384px) 100vw, 384px\" \/><figcaption class=\"wp-element-caption\"><strong>bench64<\/strong> running on the reference system, an NTSC Commodore 64c<\/figcaption><\/figure>\n\n\n\n<p>Inspired by J. G. Harston&#8217;s clever but domain-specific <a href=\"http:\/\/mdfs.net\/Software\/BBCBasic\/Testing\/\">ClockSp<\/a> benchmark, I set out to write a BASIC benchmark suite that was:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>more portable;<\/li>\n\n\n\n<li>based on a benchmark system that more people might own;<\/li>\n\n\n\n<li>and a <a href=\"https:\/\/github.com\/scruss\/bench64#design-guidelines\">bunch of other less important ideas<\/a>.<\/li>\n<\/ol>\n\n\n\n<p>Since I already had a Commodore 64, and seemingly several million other people did too, it seemed like a fair choice to use as the reference system. But the details, so many details \u2026<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"480\" src=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/12\/bench64-zxspectrum.png\" alt=\"basic bench index\n&gt;i good. ntsc c64=100\n\n1\/8 - for:\n 309.5 s; 130.8 \/s; i= 19 \n2\/8 - goto:\n 367.8 s; 72.1 \/s; i= 16 \n3\/8 - gosub:\n 340.9 s; 61.7 \/s; i= 18 \n4\/8 - if:\n 181.8 s; 80.1 \/s; i= 33 \n5\/8 - fn:\n 135.3 s; 26.9 \/s; i= 44 \n6\/8 - maths:\n 110.1 s; 3.5 \/s; i= 54 \n7\/8 - string:\n 125.8 s; 39.2 \/s; i= 48 \n8\/8 - array:\n 103 s; 16.3 \/s; i= 58 \n\noverall index= 29 \n\" class=\"wp-image-16546\" srcset=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/12\/bench64-zxspectrum.png 640w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/12\/bench64-zxspectrum-320x240.png 320w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/12\/bench64-zxspectrum-160x120.png 160w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><figcaption class=\"wp-element-caption\">It was entirely painful running the same code on a real ZX Spectrum at under \u2153 the speed of a C64<\/figcaption><\/figure>\n\n\n\n<p>(I mean: who knew that <a href=\"https:\/\/retrocomputing.stackexchange.com\/a\/17347\/439\">Commodore PET BASIC could run faster or slower depending on how your numbered your lines<\/a>? Not me \u2014 until today, that is.)<\/p>\n\n\n\n<p>While the benchmark doesn&#8217;t scale well for BASIC running on modern computers \u2014 the comparisons between a simple 8-bit processor at a few MHz and a multi-core wildly complex modern CPU at many GHz just aren&#8217;t applicable \u2014 it turns out I may have one of the fastest 8-bit BASIC computers around in the matchbox-sized shape of the <strong>MinZ v1.1<\/strong> (36.864 Z180, CP\/M 2.2, BBC BASIC [Z80] v3):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nBASIC BENCH INDEX\n&gt;I GOOD. NTSC C64=100\n\n1\/8 - FOR:\n 3.2 S; 12778 \/S; I= 1895 \n2\/8 - GOTO:\n 6.1 S; 4324.5 \/S; I= 978 \n3\/8 - GOSUB:\n 3.1 S; 6789 \/S; I= 1935 \n4\/8 - IF:\n 2.9 S; 4966.9 \/S; I= 2046 \n5\/8 - FN:\n 3.5 S; 1030.6 \/S; I= 1698 \n6\/8 - MATHS:\n 1.5 S; 255.3 \/S; I= 4000 \n7\/8 - STRING:\n 2.6 S; 1871.6 \/S; I= 2279 \n8\/8 - ARRAY:\n 3.1 S; 540.3 \/S; I= 1935 \n\nOVERALL INDEX= 1839 \n<\/pre><\/div>\n\n\n<p>That&#8217;s more than 9\u00d7 the speed of a BBC Micro Model B.<\/p>\n\n\n\n<p>Github link: <a href=\"https:\/\/github.com\/scruss\/bench64\">bench64 &#8211; a new BASIC benchmark index for 8-bit computers<\/a>.<\/p>\n\n\n\n<p>Archive download:<\/p>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/12\/bench64-main.zip\">bench64-main.zip<\/a><a href=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/12\/bench64-main.zip\" class=\"wp-block-file__button wp-element-button\" download>Download<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Nobody asked for this. Nobody needs this. But here we are \u2026 Inspired by J. G. Harston&#8217;s clever but domain-specific ClockSp benchmark, I set out to write a BASIC benchmark suite that was: Since I already had a Commodore 64, and seemingly several million other people did too, it seemed like a fair choice to [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Yes, we did need this \u00e2\u20ac\u201d bench64: a new BASIC benchmark index for 8-bit computers","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7],"tags":[2062,2721],"class_list":["post-16543","post","type-post","status-publish","format-standard","hentry","category-computers-suck","tag-basic","tag-benchmark"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pQNZZ-4iP","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/16543","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/comments?post=16543"}],"version-history":[{"count":4,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/16543\/revisions"}],"predecessor-version":[{"id":17694,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/16543\/revisions\/17694"}],"wp:attachment":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/media?parent=16543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/categories?post=16543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/tags?post=16543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}