Pluseq - Optimize Existing Code

General development discussion.

Moderators: Susan Smith, admin, Gabriel

Post Reply
dmeenen
Posts: 50
Joined: Mon Jun 08, 2009 8:34 pm
Contact:

Pluseq - Optimize Existing Code

Post by dmeenen »

This is in response to a question posted on the old Brforum.

If the attachment box (as advertised on this forum) worked, then the 2 programs would be here, but I do not see where I can attach the files on this computer. Where do you attach files, and if it does not show up, how can I get it to display?

I found pluseq.wb plus a version I wrote called fast.wb.
These basically optimize your existing code
Pluseq does this: let a=a+1 -> let a+=1

Fast.wb does that and combines separate let lines into let xxxxxxx !: let yyyyyyy
combines print lines
and changes "IF N = 0" to "If not N"

All of these things will speed up your code.

You have the option in Fast.wb to select which ones of these that you want to do by turning on/off the flag for combinelet, combineprint, or equalzero. If you use .brs as source, you will have to modify the programs.

These are based on Gary Hoff's "Speed Tips" published around 1990 - 1995 and distributed at a WB conference in Detroit.

I wish I could find my copy of this. Anyone still have a copy?
dmeenen
Posts: 50
Joined: Mon Jun 08, 2009 8:34 pm
Contact:

Post by dmeenen »

Found attachment button when replying to a message.
Don't think that was here when I created the message this morning.

Gary Hoff's "Speed Tips" was a published 2 or 3 page document. This is the doc that I wish I had a copy for......
Attachments
PLUSEQ.WB
Found attachment button when replying to message
(6.4 KiB) Downloaded 387 times
FAST.WB
written with 3.83x, gui is off
(22.17 KiB) Downloaded 407 times
John
Posts: 555
Joined: Sun Apr 26, 2009 8:27 am

Post by John »

on one hand I want to say that if you do find the speed tips document than it'd be a great addition to the brwiki... but on the other hand I wonder how relevant tips that are 10-15 years may or may not be. The language has changed a lot in the last 15 years.

-john
John Bowman
dmeenen
Posts: 50
Joined: Mon Jun 08, 2009 8:34 pm
Contact:

Post by dmeenen »

Yes I agree, but we still use "if a=0" and "let a=a+1"
GomezL
Posts: 258
Joined: Wed Apr 29, 2009 5:51 am
Contact:

Post by GomezL »

I remember that a "Small Bug" was found with the initial release.

A=A-1 correctly converted to A-=1

A=A-5-1 converted incorrectly as A-=5-1 instead of A+=-5-1 or A-=5+1

It caused some interesting problems!
Post Reply