/mobile Handheld Friendly website
x64 Ubuntu : Intel® Q6600® quad-core |
Each table row shows performance measurements for this Racket program with a particular command-line input value N.
| N | CPU secs | Elapsed secs | Memory KB | Code B | ≈ CPU Load |
|---|---|---|---|---|---|
| 500,000 | 1.73 | 1.74 | 35,340 | 262 | 0% 1% 1% 100% |
| 5,000,000 | 16.15 | 16.17 | 40,332 | 262 | 0% 100% 0% 0% |
| 50,000,000 | 154.04 | 154.12 | 80,900 | 262 | 0% 0% 43% 58% |
Read the ↓ make, command line, and program output logs to see how this program was run.
Read thread-ring benchmark to see what this program should do.
Welcome to Racket v5.3.4.
#lang racket/base ;;; The Computer Language Benchmarks Game ;;; http://benchmarksgame.alioth.debian.org/ ;;; contributed by Matthew Flatt ;; Uses Racket threads (require racket/cmdline) ;; Each thread runs this loop: (define (run id next) (let ([v (thread-receive)]) (cond [(zero? v) ;; Done (printf "~a\n" id) (exit)] [else ;; Keep going (thread-send next (sub1 v)) (run id next)]))) (let ([n (command-line #:args (n) (string->number n))]) ;; The original thread is #503. Create the rest: (let ([t1 (for/fold ([next (current-thread)]) ([id (in-range 502 0 -1)]) (thread (lambda () (run id next))))]) ;; Start: (thread-send t1 n) (run 503 t1)))
Sat, 11 May 2013 17:37:36 GMT COMMAND LINE: /usr/local/src/racket-5.3.4/bin/racket threadring.racket 50000000 PROGRAM OUTPUT: 292