Museum

Home

Lab Overview

Retrotechnology Articles

⇒ n Primes Results

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Anchors

n = 100000

n = 10000

n = 1000

n = 100

n = 25

Source Code

ALGOL

ALGOL-M

APL Family

A+

APL

NIAL

BASIC

Applesoft BASIC

Atari 2600 BASIC

BBC BASIC

Commodore BASIC

DRI Personal BASIC

HP BASIC/V

IBM 5100 BASIC

IBM PC BASIC

PICK/BASIC

Rocky Mountain BASIC

Sinclair ZX80 BASIC

Spectravideo Compumate

TI 99/4 BASIC

TRS-80 Level 1 BASIC

V-Tech Laser 50

VAX BASIC

Structured BASIC

Amiga BASIC

Dartmouth True BASIC

Microsoft QuickBASIC

Microware Basic09

Topaz S-BASIC

C

BDS C

C

C/80

Faster Than Light Speed C

COBOL

COBOL

Cromemco COBOL

Nevada COBOL

Forth

Forth

GraFORTH

HCCS FORTH

HiSoft FORTH

JForth

valFORTH

VIC FORTH

FORTRAN

Apple ][ FORTRAN

FORTRAN IV

FORTRAN-66

FORTRAN-77

Java

Java 1.0

Java 1.2

Java 1.5

LISP Family

Cambridge LISP

Common LISP

Domain Lisp

Golden Common LISP

INTERLISP

Interlisp/65

LISP/80

Pearl LISP

Scheme R³

XLISP

LOGO

Acornsoft Logo

DR LOGO

LCSI LogoWriter

Logotron LOGO

Terrapin Logo PLUS

TI LOGO

UCB LOGO

Pascal Family

Ada-83

Ada-95

Modula-2

TopSpeed Modula-2

Oberon

Oberon-2

Active Oberon

Pascal

VS Pascal

PL/I

PL/I

DRI PL/I-86

Smalltalk

Little Smalltalk

ObjectWorks

Smalltalk/V

Smalltalk-80

VisualAge Smalltalk

Other

BCPL

perl

REXX

ruby

Tcl

n Primes by Trial Division Results

15 March 2025

This is a simple benchmark, which measures the time it takes to calculate and display the first n prime numbers, using the method of trial division.

The point is to have some fixed quantum of work that is simple enough to be expressed in a limited BASIC language, as might have been implemented in ROM in an '80s home micro. That there are more efficient ways to calculate prime numbers is irrelevant. Some results in the table are marked null, indicating printing was suppressed. No other attempt was made to account for differences in I/O performance; a fast machine with a slow console will deliver a slow result (see especially the Forth OpenFirmware results).

Times are in seconds, rounded down (to the nearest tenth, if less than 3). Applesoft BASIC provides the reference implementation, for no other reason than that's the one I wrote first. Source code for all variants is linked at left. All compiler options at default settings unless otherwise noted.

Use the selection lists below to filter the results.

Manufacturer

Machine

CPU Family

Language Family

Operating System

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026