NS BASIC Tech Note                                     May 8, 1997

30. Benchmarks on MP 110 through MP 2000                   
--------------------------------------------------------------------------

We managed to get our hands on the new eMate 300 and MessagePad units and 
ran
some benchmarks on them. Before interpreting the results, be sure and 
read the
Notes, Disclaimers and Observations section below!

We also got to compare the speed of NS BASIC to Microsoft's Visual BASIC
and Visual BASIC for Applications. See below!

Unit        MP110    MP130 eMate300   MP2000
NSB Rev      2.52     3.60     3.60     3.60

CPU Intensive Tests:
Overhead      397      113      104       35
GOSUB        4005      983      717      246
IF            841      194       72        1
LET=          823      189       80        6
GOTO         1111      302      173       21
             ----     ----     ----     ----
CPU          7177     1781     1146      309

Screen Output Intensive Tests:
WINDOW         78       57       40       11
SHOW          270      155      121       57
HIDE          219      142      114       53
WPRINT        398      300      340      143
             ----     ----     ----     ----
Screen        965      655      614      265

File I/O Intensive Tests:
OPEN          171      261       85       18
PUT          1165      999      365      290
SEQ           329       78       89       31
RND           359       94       67       28
DEL          1099      686      365      264
             ----     ----     ----     ----
Soup         3122     2117      971      631

             ====     ====     ====     ====
Overall     20861     7546     5464     2128


Notes, Disclaimers and Observations

1. These tests were run on pre-release units of the eMate 300 and MP 
2000. The
final versions from Apple may have different results.

2. The test for the MP110 was run using an older version of NS BASIC. 
There were
substantial performance improvements in NS BASIC itself, beyond the 
changes Apple
made in changing from Newton OS 1.3 to 2.0. The performance improvement 
is a
combination of Apple's and NS BASIC's work.

3. All times are elapsed: lower times are faster.

4. In the CPU test, the eMate was 76% faster than the 130, while the MP 
2000 was
5.7 times faster. Tightly localized code (IF, LET, GOTO) ran much faster 
(15
times), indicating just how fast the StrongArm is. Tests which involved 
more
widely spread out code were slower, as it takes time to reference code 
not on the
current page and load it into memory.

5. The Screen test showed some improvement on the eMate, and more than 
doubled
on the MP 2000. Remember that some of the increased CPU speed is eaten up 
by
going from a 240 by 320 single bit display to a screen twice the size 
with 4 bit
gray scale. Updating information on the screen (WPRINT test) was actually 
a bit
slower on the eMate 300 than on the MP 130. Opening, showing and hiding 
windows
was still faster: there's a lot more CPU work in setting up a window than
updating it.

6. The File I/O test was a welcome improvement. Writing to flash memory 
is slow,
and we really didn't expect much here. What did they do to it so that the 
PUT and
DEL operations were sped up so much?

7. The Overall result reflects a somewhat arbitrary blend of the 3 groups 
of
tests. Some applications you run may be more CPU intensive, without 
accessing
much data, and will give different overall results.





NS BASIC speed compared to PC based BASICs
-------------------------------------------

The benchmark programs are similar - only syntactic changes.

NS BASIC A                       Visual BASIC
-------------------------        -----------------------------------
0010 t=ticks()+600               Sub Main
0020 i=0                           T=Timer+10
0030 do                            While Timer < T
0040   let i=i+1                      i=i+1
0050 loop until ticks()>t          Wend
0060 print i/10                    MsgBox I\10 & + loops per second"
                                 End Sub
NS BASIC B
-------------------------
0010 function loop(t) begin local i:=0; while ticks()>t do i:=i+1;i end
0020 print u:loop(ticks()+600)
                                 
                                     (Higher is better) 
MessagePad 2000, NS BASIC 3.6 B                 17297                     
                                                
Pentium 120, Visual BASIC                        5600
Pentium 120, Sax BASIC/WinWrap                   3800
MessagePad 2000, NS BASIC 3.6 A                   436
Pentium 120, Small Basic Interpeter               340

The Pentium results are from the June'97 issue of Dr. Dobbs Journal.

NS BASIC Program A is the same code, as close as possible. Program B
does the same thing the way a savvy NS BASIC programmer would do it.

Conclusion: NS BASIC stacks up pretty good in these tests. It's certainly
in the same ballpark, and is in some cases much faster!