27 June 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
ComputerOperating SystemLanguageRun Time (Sec.)
68000 Atari 520STTOSC Digital CP/M 68K3.8
68000 Apple Macintosh-C Manx7
68000 Apple Macintosh-C Hippo L213
Z8001 5.5 MHZUnixC1.97
Z8000 Z-LabZeus UnixC4.8
Z80CP/MDigital Basic15.7
Z80CP/MMicroSoft COBOL5115
6502 Atari 800OS Rev.BACTION! display off:
display on:
12.2
17.9
6502 Atari 800OS Rev.BBASIC389
6502 Atari 800OS Rev.BBASIC XL214
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

LanguageCompile
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 comments :

Blog Archive

Disclaimer

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.