Comparing of productivity of programs written on the Forth and the C
The remark: I'm not the author of these benchmarks! I only have ported them on SPF. The author of original shootout - Doug Bagley. The part of the code is taken from the Win32-port shootout.
The participants of competitions - VC6SP5; GCC-3.2-2; spf3.76-239; SPF4 build 11.
| VC(opt) | VC | GCC | SPF3 | SPF4 | spf4/ c lider | |
|---|---|---|---|---|---|---|
| Ackermann's Function | 0.032 | 0.087 | 0.036 | * | 0.073 | 2.2 |
| Array Access | 0.040 | 0.200 | 0.028 | 4.284 | 0.201 | 7.1 |
| Exception Mechanisms | 0.064 | 0.065 | 0.058 | 0.652 | 0.073 | 1.2 |
| Fibonacci Numbers | 0.104 | 0.154 | 0.111 | 0.943 | 0.161 | 1.5 |
| Hash Access | 0.533 | 0.577 | 0.528 | 3.575 | 0.354 | 0.6 |
| Hashes, Part II | 1.397 | 1.854 | 1.379 | 20.390 | 2.172 | 1.5 |
| Heapsort | 0.121 | 0.167 | 0.115 | * | 0.319 | 2.7 |
| Hello World | 1.287 | 1.282 | 1.690 | 1.311 | 1.400 | 1.0 |
| List Operations | 0.116 | 0.155 | 0.102 | 0.764 | 0.126 | 1.2 |
| Matrix Multiplication | 0.063 | 0.207 | 0.088 | 2.319 | 0.211 | 3.3 |
| Method Calls | 0.061 | 0.101 | 0.050 | 0.960 | 0.095 | 1.9 |
| Nested Loops | 0.011 | 0.181 | 0.080 | 0.300 | 0.216 | 19.6 |
| Object Instantiation | 1.056 | 1.127 | 1.142 | 3.743 | 1.765 | 1.6 |
| Random Number Generator | 0.083 | 0.100 | 0.040 | * | 0.096 | 2.4 |
| Sieve of Eratosthenes | 0.168 | 0.525 | 0.168 | 1.755 | 0.446 | 2.6 |
| String Concatenation | 0.019 | 0.015 | 0.015 | 0.105 | 0.014 | 0.9 |
| Reverse a File | 0.193 | 0.203 | 0.236 | 1.050 | 0.265 | 1.3 |
| Spell Checker | 0.679 | 0.840 | 0.823 | 2.412 | 0.784 | 1.1 |
| Sum a Column of Integers | 0.261 | 0.260 | 0.475 | 5.393 | 0.726 | 2.7 |
| Count Lines/Words/Chars | 0.362 | 0.680 | 0.352 | 8.411 | 0.321 | 0.9 |
| Sums: | 6.650 | 8.780 | 7.516 | 58.364 | 9.818 |
Features of testing
The test platform - Microsoft WindowsXP, AMD Duron (Spitfire) 700MHz, L1 Cache 64Kb+64Kb, L2 Cache 64Kb, memory 128Mb.
VC was tested in two modes - with included optimization on speed and without.
SPF-versions of the tests were made on the basis of the tests for gcc and gforth.
There is not SPF3 test with floating point.
Download the tests and scripts (43K).
Download the data necessary for some tests (115K).