24 lines
676 B
Racket
24 lines
676 B
Racket
#lang racket
|
|
;; Experiment with different hypotheses about data curves.
|
|
(require plot)
|
|
|
|
(define k 0.00035) ;; seconds
|
|
(define a 0.00007) ;; seconds
|
|
(define gc-time-per-n 0.0000002)
|
|
|
|
;; It's quite possible that the curve I'm seeing is logarithmic in the
|
|
;; group size for the actual work, plus some GC overhead linear in the
|
|
;; group size.
|
|
(define (RTT n)
|
|
(+ ;; Work:
|
|
(+ k (* a (/ (log n) (log 2.718))))
|
|
;; GC overhead?:
|
|
(* n gc-time-per-n)))
|
|
|
|
(parameterize ((plot-x-transform log-transform)
|
|
(plot-x-ticks (log-ticks)))
|
|
(plot-pict (function RTT 1 1076 #:label "RTT")
|
|
#:height 450
|
|
#:width 700
|
|
#:y-min 0))
|