home *** CD-ROM | disk | FTP | other *** search
- Benchmark Results
- =================
-
- In this directory there are a series of benchmark programs written in
- Euphoria and Microsoft QBasic.
-
- QBasic will be on your system if you have MS-DOS 5.0 or later. That's why
- we use it as a benchmarking reference point. type:
- qbasic /run filename.bas
- (use Alt-f Alt-x to leave the QBasic editor)
-
- To run a Euphoria program type:
- ex filename.ex
-
- The .ex and .bas suffixes are both optional.
-
- Each benchmark will run for about 15 seconds before reporting a result.
-
- We've also included "filesort.ex" - a tiny Euphoria program that we clocked
- at 9.6x the speed of the MS-DOS "sort" command on a 2000-line input file.
- Furthermore, filesort.ex uses extended memory to sort files that are too big
- for MS-DOS sort. Type:
-
- ex filesort < input_file > sorted_file
- vs.
- sort < input_file > sorted_file
-
- Using conventional technology, Euphoria could have been developed to run at
- the speed of BASIC. In fact you'd expect it to run *slower* than BASIC,
- since data types are not predetermined and fixed; it checks for uninitialized
- variables; it has dynamic storage allocation, etc. In fact, Euphoria programs
- run 10 to 20, or even more times faster than equivalent programs in Microsoft
- QBasic. And QBasic is not particularly slow. Look at some other results:
-
- Language Benchmark Result
- -------- --------- ------
- Perl (PC version) fibonnacci Euphoria is 65x faster
- PC-LISP v3.0 queens Euphoria is 28x faster
- Small C Interpreter sieve Euphoria is 545x faster
-
- We have yet to find an interpreter that even comes close to Euphoria in speed.
-
- Compare Euphoria against any interpreted or compiled language that you are
- interested in. Euphoria is * F A S T * -- but don't take our word for it.
- Make your own measurements on your own machine.
-
- About The Benchmarks
- --------------------
- sieve is the classic Byte magazine benchmark. It generates a list of
- prime numbers using the sieve technique.
-
- shell is a sort of 50 integers using the Shell sort technique.
-
- database is a series of transactions against a small in-memory data structure
- that must sometimes grow or shrink as information is added, deleted or
- updated.
-
- sequence shows the *extra* (turbo!) speed you get when you let Euphoria
- process entire sequences of data in a single statement.
-
- When benchmarking Euphoria programs you should include the statement
- "without type_check" at the top of the main file. This gives permission
- to Euphoria to simplify or remove some runtime type checking. An
- unexplained machine exception will still be impossible, and as always,
- subscript checking, uninitialized variable checking, integer overflow
- checking, stack overflow checking, and all other checks are still performed.
- Do not turn on profiling or tracing for benchmark runs.
-
- We declared 16-bit integers, "DEFINT A-Z", in the QBasic programs. Declaring
- 32-bit integers, "DEFLNG A-Z", slows things down significantly. Also, in some
- cases we used QBasic character-string operations to compare with the more
- general Euphoria sequence operations.
-
- The Euphoria interpreter achieves its high speed while maintaining the
- ultimate in language flexibility and runtime safety.
-
- Comparison with Microsoft QBasic
- --------------------------------
- The measurements below were made on a 486DX-50 with 256K cache using
- Euphoria 1.2 PD Edition running under DOS.
-
- QBasic Euphoria speed ratio
- scalar benchmarks:
- sieves per second ........... 2.84 28.6 10.1
- sorts per second ............ 74.02 1003.3 13.6
- transactions per second ..... 2358 36411 15.4
-
- sequence benchmarks:
- initializations per second .. 1100 45049 41.0
- sequence-adds per second .... 598 10830 18.1
- appends per second .......... 6258 345000 55.1
- slices per second ........... 5587 158333 28.3
- look-ups per second ......... 641 25780 40.2
-
- -------------------------------------------------------------------------------
-
- Conclusions
- -----------
- Interpreted programming languages are enjoyable and productive to use
- due to their simplicity, ease-of-use, flexibility, runtime safety,
- debuggability etc. The only drawback is speed. Compiled languages like C/C++
- have dominated, despite the fact that they are harder to learn, harder to use,
- difficult to debug, cause mysterious crashes, and require you to compile and
- link after every small change. Programmers have put up with this inconvenient,
- often frustrating, low-productivity environment for essentially one reason:
- speed.
-
- With the introduction of Euphoria, programmers can now have the best of
- both worlds!
-
-