Explore possible curve hypotheses

This commit is contained in:
Tony Garnock-Jones 2015-03-22 18:49:48 -04:00
parent a5e5142a8e
commit 0a74c19e81
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
#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))