[racket-dev] Optimization Coach suggestion / question

From: John Clements (clements at brinckerhoff.org)
Date: Fri Sep 14 18:39:22 EDT 2012

I used the optimization coach for the first time today. First, a suggestion. I wrestled with it for about five minutes before I realized that it applied only to programs written in TR. An error message here would be *really* useful; I kept mousing over and clicking and unclicking things to get the results of the coach to show up.

Second, I'm trying to see what difference inlining makes, using this program that basically just fills a vector with a sine wave. Turning on the coach for the program below suggests to me that either 
a) no inlining is occurring for the call to "supply" in the body of the loop, or
b) the coach isn't displaying that information in a way I understand.

Any hints?

John


#lang typed/racket

(require racket/flonum)

(define f (make-flvector (* 10 44100)))

(define srinv (/ 1.0 44100.0))
(define k (* srinv 440.0 1/44100 2 pi))

(: supply (Integer Flonum -> Void))
(define (supply i t)
  (flvector-set! f i (sin (* k t))))

(time 
 (for ([i (* 10 44100)])
   (define i#i (exact->inexact i))
   (supply i i#i)))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4800 bytes
Desc: not available
URL: <http://lists.racket-lang.org/dev/archive/attachments/20120914/7be898b8/attachment.p7s>

Posted on the dev mailing list.