Usually when I make a new version of Optimisationalism, I'll post it there and then, and people can instantly send the results.
This time around, however, I took a slightly different approach, and fed the results into ChatGPT and co, in the hope that they could analyse the benchmark results and suggest a few tweaks.
This is why a few days ago I did a fairly significant rewrite of how the engine handles the jumping between different commands and such. It was the AI that (eventually after about half an hour of chatting about it!) came up with the suggestion of putting Functions inside an Array, to help jump directly to the commands instead of passing through a giant Switch each time.
So, I actually optimised a fair bit, in the past week, but now it's time to see what information your system can feed back to me.
// Optimisationalism 6
// by Jayenkai
// Created 2025/8/26
// GotoJSE.com/Fr5DTshM.BAS
Dim Score(1024)
Dim MyArray(100)
Graphics 640,512,3
LoadFile
LastA=ReadInt(0)
LastB=ReadInt(1)
a=1
b=3
c=5
d=7
st$=""
cap=0;capto=200
for lim=0 to 50000 step 50
s=Mills()
for e=0 to lim+500
v=e%10
Gosub DoOptimise
next
e=Mills()-s
if e>13 and lim>200
cap=cap+1
else
capto=lim
endif
if cap>5 then lim=60000
CLS
LoadingBar Mills(),"Optimisaling","Twirl"
Flip
next
a=1
b=3
c=5
d=7
st$=""
For stage=0 to 499
v=Floor(stage/10) % 10
s=Mills()
For q=0 to capto
Gosub DoOptimise
next
Score(stage)=Mills()-s
CLS
ResetDraw
Print capto
Print Score(stage)
LoadingBar stage/5,"Optimisaling","Arc"
Flip
Next
CLS
ResetDraw
for m=0 to 9
InkRot m*36,0.7,0.3
Rect 320,(m+2)*32,640,28,1
SetCol 255,255,255
SetFontSize 8
if m==0 then Text 8,(m+2)*32,"If's",0
if m==1 then Text 8,(m+2)*32,"+ Simple Addition",0
if m==2 then Text 8,(m+2)*32,"+ Comma Quirk",0
if m==3 then Text 8,(m+2)*32,"+ Division",0
if m==4 then Text 8,(m+2)*32,"+ Command",0
if m==5 then Text 8,(m+2)*32,"+ Trigonometry",0
if m==6 then Text 8,(m+2)*32,"+ Multi-Command",0
if m==7 then Text 8,(m+2)*32,"+ Raw String",0
if m==8 then Text 8,(m+2)*32,"+ Random String",0
if m==9 then Text 8,(m+2)*32,"+ Array",0
SetFontSize 16
for x=0 to 4
s=0
for n=0 to 9
s=s+Score(m*10+n+(x*100))
next
Text (96*(x+2)),(m+2)*32,s,1
next
next
Text jscrw-16,jscrh-16,"Tap ; to save screenshot ",2
Text 8,8,"Optimisationalism 6",0
Text jscrw-8,jscrh-74,"Benchmark "+capto,2
Text jscrw-8,jscrh-54,LastA,2
Text jscrw-8,jscrh-34,LastB,2
SetFontSize 8
Text jscrw-8,jscrh-90,"Score (Higher = Faster)",2
Text jscrw-8,32,"Time (Lower = Faster)",2
WriteFile(0,capto)
WriteFile(1,LastA)
SaveFile
Print Version()
Flip
end
.DoOptimise
if v==1 then a=a+b+c+d
if v==2 then a=a+(b,c,d)
if v==3 then a=a+(b+c)/d
if v==4 then a=a+Rand(b,c)*d
if v==5 then a=a+Sin(b,c)*d
if v==6 then a=a+Round(Rand(0,90))+Ceil(Rand(0,90))+Floor(Rand(0,90))
if v==7 then st$=st$+(("b"+"c")+"d")
if v==8 then st$=(Chr$(Rand(48,57))+Chr$(Rand(48,57)))*Rand(1,3)
if v==9 then MyArray(Rand(0,100))=MyArray(Rand(0,100))
Return
The task is easy enough. Run this script about 3 or 4 times until the benchmark score on the bottom right gives roughly the same value for each run.
Then take a screenshot, and post it somewhere that I can see it!
Easy enough, right?!
The Discord might be a good place to post your images.
There's a thread over on SoCoder, too if you want to check out other user's scores.
[verse]
Trimming out the slow bits,
Cutting out the grit.
There's so much left to optimise,
We're gonna optimise it.
[alt-verse]
Make things ever faster.
Tweak the slower bits,
Tweak until you speed them up,
We're gonna optimise it.
[break]
[chorus]
Java script, it burns a hole,
Throughout my browsers very soul.
Making websites slow and clunky,
Because the code is old and chunky.
Take it all and make it faster,
Try not to cause a code disaster.
Then all can play your browser games,
Nice and fast. That is my aim.
[break]
[verse]
Strip away the bloatware,
Keep the code concise.
A tidy script will always run,
We're gonna optimise it.
[alt-verse]
Test it in the morning,
Check it late at night.
If the loops are running slow,
We're gonna optimise it.
[break]
[chorus]
Java script, it burns a hole,
Throughout my browsers very soul.
Making websites slow and clunky,
Because the code is old and chunky.
Take it all and make it faster,
Try not to cause a code disaster.
Then all can play your browser games,
Nice and fast. That is my aim.
[bridge]
Minify the functions, shrink it all down really tight,
We'll switch to mostly globals, keep memory usage light.
Garbage is collecting, clear it all out if you can,
And if the code is hanging, then rewrite it with a plan.
Image draws are slowing down, a canvas under stress.
And older browsers can't compete, they can't complete the test.
We'll upload to the server, all the optimising done.
And then the players can play the games, and all have lots of fun.
[break]
[chorus]
Java script, it burns a hole,
Throughout my browsers very soul.
Making websites slow and clunky,
Because the code is old and chunky.
Take it all and make it faster,
Try not to cause a code disaster.
Then all can play your browser games,
Nice and fast. That is my aim.
[Dave and Brian are tinkering with a complex arrangement of tubes, which feed Irn Bru syrup into Cake Batter.]
Brian: [pouring a bottle of syrup into a funnel] This is the last bottle, Dave.
Dave: It's fine, Greenie's getting us some. Don't worry.
Brian: But I am worried. What if we can't make any more of the Irn Bru ScrunchCakes. We're doomed.
Dave: We can use Purple for a few, nobody'll notice.
Brian: People will notice, David. They noticed when we started using Asda Sausages instead of Aldi ones. They'll notice this!
Green: [entering] No luck. Nobody stocks it anymore.
Dave: What do you mean nobody stocks it? It's Sodastream.
Green: Nope. Looks like it's a dying artform, Dave. No shops had anything, not even the gas canisters. Well, Morrisons had the ginger beer syrup...
[Greenie proudly holds up a bottle of Ginger Beer Sodastream Syrup]
Brian: We can't make Irn Bru ScrunchCakes with that. We need Irn Bru Syrup!
Green: Maybe we could just use the actual drink?
Dave: [gasps] The Fizz, Greenie. The Fizz!
Brian: We already tried boiling out the fizz and reducing it back to a syrup, but.. [points up at glowing orange funk on the ceiling.]
Dave: Science is science, but dangerous science is .. apparently not allowed, anymore?
Green: Pretty sure what you're doing isn't science.
Dave: What if we use your Ginger Beer syrup as a conduit for the Irn Bru flavour?
Green: Do what?
Dave: Freely Energised Recipe Distillation. FERD for short! We basically vibrate the molecules of the Irn Bru and Ginger Beer until they taste like Irn Bru!
Green: That's not how molecules work.
Brian: .. You mean, mix the flavours?
Dave: Sure.
[Dave grabs a small beaker from under the kitchen cabinet]
Green: Dave, be careful.
Dave: This is completely safe! I've calculated everything perfectly this time...
Brian: When?
Dave: Just now. In my head. We're fine.
[Dave pours a little of each syrup into the beaker, just as Mrs Thompson enters the kitchen]
Mrs Thompson: Why do I smell burning sugar?
Dave: That's just the molecular resonance!
Green: That's just the what now?
Brian: I'm just going to hide under the counter for a short while...
[End Credits Roll]
Views 10, Upvotes 0
Daily Blog
,
Jse
,
Optimisationalism
Places
Archives
Site credits : All of the above : Jayenkai
(c) Jayenkai 2023 and onwards, RSS feed
7
Blog - 🌊 - 03 - Optimisationalism 6 - AGameAWeek