home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / euphoria / bench.doc < prev    next >
Text File  |  1994-03-10  |  5KB  |  111 lines

  1.         Benchmark Results
  2.         =================
  3.  
  4.  In this directory there are a series of benchmark programs written in
  5.  Euphoria and Microsoft QBasic.  
  6.  
  7.  QBasic will be on your system if you have MS-DOS 5.0 or later. That's why
  8.  we use it as a benchmarking reference point. type: 
  9.     qbasic /run filename.bas 
  10.     (use Alt-f Alt-x to leave the QBasic editor)
  11.  
  12.  To run a Euphoria program type:
  13.     ex filename.ex
  14.  
  15.  The .ex and .bas suffixes are both optional.
  16.  
  17.  Each benchmark will run for about 15 seconds before reporting a result.
  18.  
  19.  We've also included "filesort.ex" - a tiny Euphoria program that we clocked
  20.  at 9.6x the speed of the MS-DOS "sort" command on a 2000-line input file. 
  21.  Furthermore, filesort.ex uses extended memory to sort files that are too big
  22.  for MS-DOS sort. Type: 
  23.  
  24.         ex filesort < input_file > sorted_file
  25.                vs.
  26.     sort < input_file > sorted_file
  27.  
  28.  Using conventional technology, Euphoria could have been developed to run at 
  29.  the speed of BASIC. In fact you'd expect it to run *slower* than BASIC, 
  30.  since data types are not predetermined and fixed; it checks for uninitialized
  31.  variables; it has dynamic storage allocation, etc. In fact, Euphoria programs
  32.  run 10 to 20, or even more times faster than equivalent programs in Microsoft
  33.  QBasic. And QBasic is not particularly slow. Look at some other results: 
  34.  
  35.  Language              Benchmark       Result
  36.  --------              ---------       ------
  37.  Perl (PC version)    fibonnacci    Euphoria is  65x faster
  38.  PC-LISP v3.0        queens        Euphoria is  28x faster
  39.  Small C Interpreter    sieve        Euphoria is 545x faster
  40.  
  41.  We have yet to find an interpreter that even comes close to Euphoria in speed.
  42.  
  43.  Compare Euphoria against any interpreted or compiled language that you are 
  44.  interested in. Euphoria is * F A S T * -- but don't take our word for it. 
  45.  Make your own measurements on your own machine. 
  46.  
  47.  About The Benchmarks
  48.  --------------------
  49.  sieve is the classic Byte magazine benchmark. It generates a list of 
  50.        prime numbers using the sieve technique.
  51.  
  52.  shell is a sort of 50 integers using the Shell sort technique.
  53.  
  54.  database is a series of transactions against a small in-memory data structure
  55.        that must sometimes grow or shrink as information is added, deleted or
  56.        updated.
  57.  
  58.  sequence shows the *extra* (turbo!) speed you get when you let Euphoria 
  59.        process entire sequences of data in a single statement. 
  60.  
  61.  When benchmarking Euphoria programs you should include the statement
  62.  "without type_check" at the top of the main file. This gives permission
  63.  to Euphoria to simplify or remove some runtime type checking.  An 
  64.  unexplained machine exception will still be impossible, and as always, 
  65.  subscript checking, uninitialized variable checking, integer overflow 
  66.  checking, stack overflow checking, and all other checks are still performed.
  67.  Do not turn on profiling or tracing for benchmark runs.
  68.  
  69.  We declared 16-bit integers, "DEFINT A-Z", in the QBasic programs. Declaring
  70.  32-bit integers, "DEFLNG A-Z", slows things down significantly. Also, in some
  71.  cases we used QBasic character-string operations to compare with the more 
  72.  general Euphoria sequence operations.
  73.  
  74.  The Euphoria interpreter achieves its high speed while maintaining the 
  75.  ultimate in language flexibility and runtime safety. 
  76.  
  77.  Comparison with Microsoft QBasic
  78.  -------------------------------- 
  79.  The measurements below were made on a 486DX-50 with 256K cache using 
  80.  Euphoria 1.2 PD Edition running under DOS. 
  81.  
  82.                          QBasic         Euphoria     speed ratio    
  83.  scalar benchmarks:
  84.    sieves per second ...........       2.84             28.6         10.1
  85.    sorts per second ............      74.02           1003.3         13.6
  86.    transactions per second .....    2358             36411           15.4
  87.  
  88.  sequence benchmarks:
  89.    initializations per second ..    1100             45049           41.0
  90.    sequence-adds per second ....     598             10830           18.1
  91.    appends per second ..........    6258            345000           55.1
  92.    slices per second ...........    5587            158333           28.3
  93.    look-ups per second .........     641             25780           40.2
  94.  
  95. -------------------------------------------------------------------------------
  96.  
  97.             Conclusions
  98.             -----------
  99.  Interpreted programming languages are enjoyable and productive to use
  100.  due to their simplicity, ease-of-use, flexibility, runtime safety, 
  101.  debuggability etc. The only drawback is speed. Compiled languages like C/C++
  102.  have dominated, despite the fact that they are harder to learn, harder to use,
  103.  difficult to debug, cause mysterious crashes, and require you to compile and
  104.  link after every small change. Programmers have put up with this inconvenient,
  105.  often frustrating, low-productivity environment for essentially one reason: 
  106.  speed.
  107.  
  108.  With the introduction of Euphoria, programmers can now have the best of 
  109.  both worlds! 
  110.   
  111.