miércoles, 27 de junio de 2012

Sieve of Eratosthenes

TODO: hay un bug en el codigo, probar lo nuevo en cc65.. la version de action ta mala :(

Sieve of Eratosthenes o la Criba de Eratóstenes

Byte: http://www.xgc.com/benchmarks/sieve_c.htm

TODO: revisar: probar: http://www.atarimagazines.com/v7n7/SuperSieve.html

FIRST ST PERFORMANCE TEST
http://www.atarimagazines.com/v4n6/STperformancetest.html
Computer Operating System Language Run Time (Sec.)
68000 Atari 520ST TOS C Digital CP/M 68K 3.8
68000 Apple Macintosh - C Manx 7
68000 Apple Macintosh - C Hippo L2 13
Z8001 5.5 MHZ Unix C 1.97
Z8000 Z-Lab Zeus Unix C 4.8
Z80 CP/M Digital Basic 15.7
Z80 CP/M MicroSoft COBOL 5115
6502 Atari 800 OS Rev.B ACTION! display off:
display on:
12.2
17.9
6502 Atari 800 OS Rev.B BASIC 389
6502 Atari 800 OS Rev.B BASIC XL 214
ADVAN COMPILER BASIC
http://www.atarimagazines.com/v4n12/Compiler.html
Advan BASIC is filled with shortcuts like this. By the way, it ran my version of the Sieve of Eratosthenes in 13.8 seconds. The MMG compiler took 9 seconds, BASIC XL took 67 seconds and Atari BASIC hasn't finished yet. If that isn't fast enough, you can rewrite key routines in assembly language from within BASIC. Advan BASIC recognizes assembler mnemonics almost as if they were BASIC keywords. Not only is this great for people who know assembly language, but it can be a teriffic learning environment too.

ADVAN OPTIMIZER
http://www.atarimagazines.com/v6n2/BASICBonanza.html
Advan BASIC was already pretty fast. Now it's the fastest BASIC in Atari history. In our Sieve Benchmark, the Advan Optimizing Compiler is about four times faster than the MMG Compiler, six times faster than regular Advan, 20 times faster than compiled Turbo-BASIC XL and 120 times faster than uncompiled Atari BASIC. In fact, it's more than half the speed of ACTION!- that's getting real close to pure assembly language.

Lights, Camera, ACTION!
http://www.atarimagazines.com/hi-res/v1n4/action.php

Language Compile
Time
Object
Code
Run
Time
BASIC
FORTH
Action!
C (Z-80)
---
3 sec
< 1 sec 132 sec
443
114
423
290
3140 secs
168 secs
18 secs
14 secs


-->KYAN PASCAL
http://www.atarimagazines.com/v4n7/kyanpascal.html
The resulting object file has a very rapid run-time. Ten iterations of the Eratosthenes Prime Number Sieve (see "First ST Performance Test," Antic, October 1985) ran in about 120 seconds with the screen on. With the screen off, the same program ran in just 80 seconds.

http://devweb.cl/atari/cc65/sieve_gg.c
http://devweb.cl/atari/cc65/sieve_gg.xex



PD; post pendiente desde 2009 :S

No hay comentarios.:

Publicar un comentario