| Shuffle.c counts the number of occurrences of | card type (ace, two, three, ..., queen, king) | at position 103 in a stack of cards ( 4 decks | of 52 cards) for 26,000 shuffles. Ideally the | number of cards observed of the same type at | position 103 (or any other position) would be | 26000 / 13 = 2000 assuming the random number | generator provides a uniform distribution.
The Forth SHUFFLE benchmark shows the quality of your compiler's integer code as compared to that of an optimizing "C" compiler. Results for a large number of C compilers on a variety of systems are available in the .tbl file.
This benchmark is completely dominated by the speed of the random number generator. The particular code needed here is quite specialized (multiply-add on a memory array). Many C compilers are smarter than iForth, but the Athlon still wins by brute-force.
The SHUFFLE result puts iForth in the following company (shuffle.tbl):
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<( shuffle )>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> System OS CPU/FPU CPU Run Time REF (MHz) (seconds) ### ---------------------- -------------- ----------- ----- --------- --- ------------------------------------------------------------------------- AMD running iForth W2K Athlon 900 70.28 ------------------------------------------------------------------------- 001 SGI Origin 200 Irix 6.4 MIPS R10000 180 96.96 14 002 SGI Origin 200 Irix 6.4 MIPS R10000 180 102.91 7 003 SGI O2 Irix 6.3 MIPS R10000 175 136.69 4 004 SGI O2 Irix 6.3 MIPS R10000 175 160.22 4 005 Sun UltraSPARC-2 Solaris 2.5.1 UltraSPARC 300 168.41 14 006 AMD K6 Windows 95 AMD K6 200 173.13 13 007 Pentium Pro Windows 95 Pentium Pro 200 193.55 12 008 PC Clone Windows NT 4.0 AMD K5PR133 100 215.20 3 009 PC Clone Windows 95 AMD K5PR133 100 216.52 3 010 SGI Challenge S Irix 6.2 MIPS R4400 200 230.09 5 011 Pentium P5-166 Windows 95 Pentium 166 240.95 6 012 PC Clone SCO V5.0.2c AMD K5PR133 100 252.57 3 013 Dell XPS Pro 200n NT 3.51 Pentium Pro 200 252.85 2 014 SGI Indy Irix 6.2 MIPS R5000 150 261.23 7 015 IBM RS/6000 25E AIX 3.2.5 PPC601 66 264.87 11 016 Sun UltraSPARC-1 SunOS 5.5.1 UltraSPARC 143 314.08 1 017 HP 9000/J210XC HP-UX 10.20 PA7200_2CPU 120 329.82 10 018 Dell XPS Pr200n No opt NT 3.51 Pentium Pro 200 347.65 2 019 SGI Onyx Irix 6.2 MIPS R8000 75 366.55 8 020 Brett Station ATX Linux 2.0.0 Pentium Pro 180 393.02 9 021 Sun SPARCstation 20/HS SunOS 5.5 HyperSPARC 100 404.88 1 022 IBM RS/6000 25E AIX 3.2.5 PPC601 66 417.35 11 023 HP 9000/712 HP-UX 10.20 HP-PA7100LC 100 443.06 10 024 Sun SPARCstation 20/61 SunOS 5.5 SuperSPARC 60 472.07 1 025 PC Clone Linux 3.0.3 AMD K5PR133 100 474.63 3 026 Escom P100 Win95/DOS Pentium 100 478.78 2 ------------------------------------------------------------------------- P54C running iForth NT 4.0 Pentium 166 506.58 ------------------------------------------------------------------------- 027 PC Clone MS DOS 6.22 Am5x86-P75 133 559.84 1 028 Pentium P5-90 MS DOS 6.22 Pentium P5 90 578.63 1 029 Pentium P5-90 MS DOS 6.22 Pentium P5 90 580.44 1 030 Escom P100 No opt Win95/DOS Pentium 100 617.97 2 031 SPARCserver 690MP SunOS 4.1.3 SuperSPARC 50 832.23 1 032 Escom 486 Win95/DOS 80486DX2 66 1375.83 2 033 Escom 486 No opt Win95/DOS 80486DX2 66 1708.36 2 --- ### ----------------------------------------------------------------------free counter