Benchmark Results ================= In this directory there are a series of benchmark programs written in Euphoria and Microsoft QBasic. QBasic should be available to you if you have MS-DOS 5.0 or later, although it might not be installed under Windows 95. To run a QBasic program type: qbasic /run filename.bas 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 -------- --------- ------ Java (JDK 1.0.2) sieve Euphoria is 8x faster 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 based on 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 that kicks in when you take advantage of Euphoria's unique ability to 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 gave QBasic the benefit of the doubt by declaring 16-bit integers, "DEFINT A-Z". 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 much 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 Pentium-150 with 512K cache, using Euphoria 1.5a PD Edition running in a Windows 95 DOS window. QBasic Euphoria speed ratio scalar benchmarks: sieves per second ........... 228.45 2598.0 11.4 sorts per second ............ 348.25 4626.7 13.3 transactions per second ..... 9565 138338 14.5 sequence benchmarks: initializations per second .. 4768 266533 55.9 sequence-adds per second .... 2375 74219 31.3 appends per second .......... 10280 2368770 230.4 slices per second ........... 10755 870431 80.9 look-ups per second ......... 2436 139667 57.3 ------------------------------------------------------------------------------- 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!