Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Integer BASIC
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Performance== Because Integer BASIC processed more of the original [[source code]] into tokens, the runtime was faster than versions that required additional runtime parsing. For comparison, [[Tiny BASIC]] tokenized only the line number,<ref>{{cite magazine |title=Build Your Own BASIC |first=Dennis |last=Allison |magazine=Dr. Dobb's Journal |volume=1 |number=1 |date=1976 |url=https://archive.org/details/dr_dobbs_journal_vol_01/page/n11 |page=11}}</ref> while MS BASICs tokenized only the keywords. So for instance, while Integer BASIC would convert the line {{code|100 GOTO 200}} entirely into tokens that could be immediately read and performed, in MS BASIC only the line number and GOTO would be tokenized, the "200" was left in its original ASCII format and had to be re-parsed into a 16-bit integer every time the line was encountered.<ref name=altair>{{cite web |url=http://www.rjh.org.uk/altair/4k/int_dis_11.htm |archive-url=https://web.archive.org/web/20011105014524/http://www.rjh.org.uk/altair/4k/int_dis_11.htm |archive-date=5 November 2001 |title=Altair BASIC 3.2 (4K) - Annotated Disassembly |first=Roger |last=Hardiman |page=1.11}}</ref> Additionally, working solely with integer math provides another major boost in speed. This is due both to the smaller 16-bit format requiring fewer memory accesses, as well as removing the need to move the floating-point decimal after calculations. As many [[Benchmark (computing)|computer benchmarks]] of the era were small and often performed simple math that did not require floating-point, Integer BASIC trounced most other BASICs.{{efn|[[Bill Gates]] complained about this, stating that it was unfair to compare Integer BASIC to a "real" BASIC like MS.<ref name=rugg2>{{cite magazine |first1=Tom |last1=Rugg |first2=Phil |last2=Feldman |title=BASIC timing comparisons… revised and updated |magazine=Kilobaud |date=October 1977 |pages=20–25 |url=https://archive.org/details/kilobaudmagazine-1977-10}}</ref>}} On one of the earliest known microcomputer benchmarks, the [[Rugg/Feldman benchmarks]], Integer BASIC was well over twice as fast as Applesoft BASIC on the same machine.<ref name=rugg>{{cite magazine |first1=Tom |last1=Rugg |first2=Phil |last2=Feldman |title=BASIC Timing Comparisons… information for speed freaks |magazine=Kilobaud |date=June 1977 |pages=66–70 |url=https://archive.org/details/kilobaudmagazine-1977-06}}</ref> In the [[Byte Sieve]], where math was less important but array access and looping performance dominated, Integer BASIC took 166 seconds while Applesoft took 200.<ref>{{cite magazine |title=A High-Level Language Benchmark |first=Jim |last=Gilbreath |magazine=Byte |date=September 1981 |url=https://archive.org/details/byte-magazine-1981-09/page/n181 |page=192}}</ref> A review of Galfo Systems' Integer BASIC Compiler found that it produced code that is about 1.5 to eight times faster than compiled Applesoft BASIC, ten times faster than interpreted Integer BASIC, and 15 times faster than interpreted Applesoft.<ref name="byte198209">{{Cite magazine |last=Taylor |first=Joseph H. |last2=Taylor |first2=Jeffrey S. |date=September 1982 |title=A Comparison of Five Compilers for Applesoft BASIC |url=https://archive.org/details/byte-magazine-1982-09/page/n438/mode/1up?view=theater |access-date=2024-12-30 |magazine=BYTE |pages=440-464}}</ref> Integer BASIC did not appear in the [[Creative Computing Benchmark]], which was first published in 1983, by which time the language was no longer included with Apple computers.<ref>{{cite magazine |magazine=Creative Computing |date=November 1983 |first=David |last=Ahl |title=Benchmark Comparison Test |url=https://archive.org/details/creativecomputing-1983-11/page/n271/mode/2up |page=260}}</ref> The following test series, taken from both of the original Rugg/Feldman articles,<ref name=rugg/><ref name=rugg2/> show Integer's performance relative to the MS-derived BASIC on the same platform. {| class="wikitable" |- ! System !! CPU !! BASIC !! Test 1 !! Test 2 !! Test 3 !! Test 4 !! Test 5 !! Test 6 !! Test 7 |- | Apple II || 6502 @ 1 MHz || Integer BASIC || 1.3 || 3.1 || 7.2 || 7.2 || 8.8 || 18.5 || 28.0 |- | Apple II || 6502 @ 1 MHz || [[Applesoft BASIC]] || 1.3 || 8.5 || 16.0 || 17.8 || 19.1 || 28.6 || 44.8 |} Here is a summary of what each test did: *Test 1: for/next loop to 1000. *Test 2: if/then loop with compare to 1000. *Test 3: same as 2 with added multiplication, division, addition subtraction by same variable. *Test 4: same as 3 with added multiplication, division, addition subtraction by constants. *Test 5: same as 4 with added subroutine call. *Test 6; same as 5 with added inner loop. *Test 7: same as 6 with added table population.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)