<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://bitchin100.com/wiki/index.php?action=history&amp;feed=atom&amp;title=BASIC_Efficiency_Tips</id>
	<title>BASIC Efficiency Tips - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://bitchin100.com/wiki/index.php?action=history&amp;feed=atom&amp;title=BASIC_Efficiency_Tips"/>
	<link rel="alternate" type="text/html" href="https://bitchin100.com/wiki/index.php?title=BASIC_Efficiency_Tips&amp;action=history"/>
	<updated>2026-04-29T19:09:11Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://bitchin100.com/wiki/index.php?title=BASIC_Efficiency_Tips&amp;diff=1733&amp;oldid=prev</id>
		<title>99.6.119.22 at 04:16, 29 June 2009</title>
		<link rel="alternate" type="text/html" href="https://bitchin100.com/wiki/index.php?title=BASIC_Efficiency_Tips&amp;diff=1733&amp;oldid=prev"/>
		<updated>2009-06-29T04:16:10Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 21:16, 28 June 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l14&quot;&gt;Line 14:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 14:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Use SPACE$(X) to assign X number of spaces rather than STRING$(X,32).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Use SPACE$(X) to assign X number of spaces rather than STRING$(X,32).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Another surprise: use REM instead of &amp;quot;&amp;#039;&amp;quot;. This saves two bytes per occurrence. Of course you should remove all REM statements of both types from your running copy.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Another surprise: use REM instead of &amp;quot;&amp;#039;&amp;quot;. This saves two bytes per occurrence. Of course you should remove all REM statements of both types from your running copy.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Model T Developer Reference]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>99.6.119.22</name></author>
	</entry>
	<entry>
		<id>https://bitchin100.com/wiki/index.php?title=BASIC_Efficiency_Tips&amp;diff=1732&amp;oldid=prev</id>
		<title>Ronw: Regarding &quot;Initialize all variables before you start the main body&quot;, added the nuance regarding how to arrange the order in which variables are defined influences speed of interpretation.</title>
		<link rel="alternate" type="text/html" href="https://bitchin100.com/wiki/index.php?title=BASIC_Efficiency_Tips&amp;diff=1732&amp;oldid=prev"/>
		<updated>2009-06-28T19:56:56Z</updated>

		<summary type="html">&lt;p&gt;Regarding &amp;quot;Initialize all variables before you start the main body&amp;quot;, added the nuance regarding how to arrange the order in which variables are defined influences speed of interpretation.&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 12:56, 28 June 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l9&quot;&gt;Line 9:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Put all initialization code at the end of your program and do a GOTO to a GOSUB. Little used routines at the end make for a dramatic improvement in speed since BASIC must search from the beginning for each line referenced.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Put all initialization code at the end of your program and do a GOTO to a GOSUB. Little used routines at the end make for a dramatic improvement in speed since BASIC must search from the beginning for each line referenced.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Put all time critical code at the beginning of the program for the same reason.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Put all time critical code at the beginning of the program for the same reason.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Initialize all variables before you start the main body of the code. This creates a stable, linear table of variables that are accessed more rapidly.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Initialize all variables before you start the main body of the code. This creates a stable, linear table of variables that are accessed more rapidly&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;.  Moreover, optimize the order in which you define the variables so that the most frequently referenced variable is the first to be defined, the second most frequently referenced variable is the second to be defined, and so on.  Thus when the BASIC interpreter encounters a previously defined variable, the time it consumes to find said variable among the linear table of variables will be comensurate with the importance (i.e., frequency of reference) of the variable and consequently BASIC program interpretation time is optimally short&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Do not use the supposed short-cut of raising a number to the 0.5 power to save time over the SQR routine. Inaccuracies in the 11th and 12th decimal might tend to screw up any further calculations in which you might use the result.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Do not use the supposed short-cut of raising a number to the 0.5 power to save time over the SQR routine. Inaccuracies in the 11th and 12th decimal might tend to screw up any further calculations in which you might use the result.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Assign literals used more than once in a program to a variable. Do this in your initialization code. Almost one byte per characters is saved for each such duplication eliminated.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Assign literals used more than once in a program to a variable. Do this in your initialization code. Almost one byte per characters is saved for each such duplication eliminated.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Use SPACE$(X) to assign X number of spaces rather than STRING$(X,32).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Use SPACE$(X) to assign X number of spaces rather than STRING$(X,32).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Another surprise: use REM instead of &amp;quot;&amp;#039;&amp;quot;. This saves two bytes per occurrence. Of course you should remove all REM statements of both types from your running copy.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Another surprise: use REM instead of &amp;quot;&amp;#039;&amp;quot;. This saves two bytes per occurrence. Of course you should remove all REM statements of both types from your running copy.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ronw</name></author>
	</entry>
	<entry>
		<id>https://bitchin100.com/wiki/index.php?title=BASIC_Efficiency_Tips&amp;diff=1731&amp;oldid=prev</id>
		<title>Ronw: Corrected &quot;net savings&quot; regarding consolidation by use of multiple statements per line versus the quantity of eliminated lines.</title>
		<link rel="alternate" type="text/html" href="https://bitchin100.com/wiki/index.php?title=BASIC_Efficiency_Tips&amp;diff=1731&amp;oldid=prev"/>
		<updated>2009-06-28T19:41:32Z</updated>

		<summary type="html">&lt;p&gt;Corrected &amp;quot;net savings&amp;quot; regarding consolidation by use of multiple statements per line versus the quantity of eliminated lines.&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 12:41, 28 June 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l5&quot;&gt;Line 5:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 5:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Eliminate the variable argument on the NEXT portion of For-Next loops. Here is a real kicker. Besides the savings of one byte of storage for each such occurrence, integers are 60 percent slower, reals are 50 percent slower, and double precision is 80 percent slower when you specify the variable than when you simply specify NEXT.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Eliminate the variable argument on the NEXT portion of For-Next loops. Here is a real kicker. Besides the savings of one byte of storage for each such occurrence, integers are 60 percent slower, reals are 50 percent slower, and double precision is 80 percent slower when you specify the variable than when you simply specify NEXT.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Eliminate final quote marks on all literals that appear at the end of lines. A byte is saved for each.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Eliminate final quote marks on all literals that appear at the end of lines. A byte is saved for each.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Use as many multiple statements per line as you can since for each line number eliminated, you have a net savings of &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;two &lt;/del&gt;bytes (the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;three &lt;/del&gt;needed for each separate line less the one byte used for each &amp;quot;:&amp;quot;).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Use as many multiple statements per line as you can since for each line number eliminated, you have a net savings of &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;four &lt;/ins&gt;bytes (the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;five &lt;/ins&gt;needed for each separate line less the one byte used for each &amp;quot;:&amp;quot;).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Eliminate spaces. Your archival copy should have them for intelligibility, but your running copy will save one byte for each space that is removed.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Eliminate spaces. Your archival copy should have them for intelligibility, but your running copy will save one byte for each space that is removed.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Put all initialization code at the end of your program and do a GOTO to a GOSUB. Little used routines at the end make for a dramatic improvement in speed since BASIC must search from the beginning for each line referenced.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Put all initialization code at the end of your program and do a GOTO to a GOSUB. Little used routines at the end make for a dramatic improvement in speed since BASIC must search from the beginning for each line referenced.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ronw</name></author>
	</entry>
	<entry>
		<id>https://bitchin100.com/wiki/index.php?title=BASIC_Efficiency_Tips&amp;diff=1730&amp;oldid=prev</id>
		<title>99.6.119.22: New page: (From a Letter in Portable 100, Richard Horowitz):  # All variables should be typed at the beginning of the program. Use DEFINT, DEFSNG, etc. Even string variables should be typed because ...</title>
		<link rel="alternate" type="text/html" href="https://bitchin100.com/wiki/index.php?title=BASIC_Efficiency_Tips&amp;diff=1730&amp;oldid=prev"/>
		<updated>2009-06-28T17:47:19Z</updated>

		<summary type="html">&lt;p&gt;New page: (From a Letter in Portable 100, Richard Horowitz):  # All variables should be typed at the beginning of the program. Use DEFINT, DEFSNG, etc. Even string variables should be typed because ...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;(From a Letter in Portable 100, Richard Horowitz):&lt;br /&gt;
&lt;br /&gt;
# All variables should be typed at the beginning of the program. Use DEFINT, DEFSNG, etc. Even string variables should be typed because the &amp;quot;$&amp;quot; used with each such variable takes a byte of storage.&lt;br /&gt;
# Use integers wherever possible, especially in counting loops. The time savings is dramatic. Integers are 2 1/2 times faster than the default of double precision.&lt;br /&gt;
# Eliminate the variable argument on the NEXT portion of For-Next loops. Here is a real kicker. Besides the savings of one byte of storage for each such occurrence, integers are 60 percent slower, reals are 50 percent slower, and double precision is 80 percent slower when you specify the variable than when you simply specify NEXT.&lt;br /&gt;
# Eliminate final quote marks on all literals that appear at the end of lines. A byte is saved for each.&lt;br /&gt;
# Use as many multiple statements per line as you can since for each line number eliminated, you have a net savings of two bytes (the three needed for each separate line less the one byte used for each &amp;quot;:&amp;quot;).&lt;br /&gt;
# Eliminate spaces. Your archival copy should have them for intelligibility, but your running copy will save one byte for each space that is removed.&lt;br /&gt;
# Put all initialization code at the end of your program and do a GOTO to a GOSUB. Little used routines at the end make for a dramatic improvement in speed since BASIC must search from the beginning for each line referenced.&lt;br /&gt;
# Put all time critical code at the beginning of the program for the same reason.&lt;br /&gt;
# Initialize all variables before you start the main body of the code. This creates a stable, linear table of variables that are accessed more rapidly.&lt;br /&gt;
# Do not use the supposed short-cut of raising a number to the 0.5 power to save time over the SQR routine. Inaccuracies in the 11th and 12th decimal might tend to screw up any further calculations in which you might use the result.&lt;br /&gt;
# Assign literals used more than once in a program to a variable. Do this in your initialization code. Almost one byte per characters is saved for each such duplication eliminated.&lt;br /&gt;
# Use SPACE$(X) to assign X number of spaces rather than STRING$(X,32).&lt;br /&gt;
# Another surprise: use REM instead of &amp;quot;&amp;#039;&amp;quot;. This saves two bytes per occurrence. Of course you should remove all REM statements of both types from your running copy.&lt;/div&gt;</summary>
		<author><name>99.6.119.22</name></author>
	</entry>
</feed>