Eduardo Cavazos
2009-02-15 19:38:34 UTC
Hello,
When profiling my program, I notice 'get-modelview-matrix' is
consistently high in the list. Here it is:
(define (get-modelview-matrix)
(let ((bv (make-bytevector (* 16 8))))
(glGetDoublev GL_MODELVIEW_MATRIX bv)
bv))
I could write it like this:
(define get-modelview-matrix
(let ((bv (make-bytevector (* 16 8))))
(lambda ()
(glGetDoublev GL_MODELVIEW_MATRIX bv)
bv)))
That's of course much faster. But, one of the callers of
'get-modelview-matrix' really does need a copy of the matrix. So I
modified the call site as such:
(bytevector-copy (get-modelview-matrix))
and then 'bytevector-copy' shows up high in the list. :-)
So my question is, is the first version of 'get-modelview-matrix' shown
above inherently "hot"?
Ed
When profiling my program, I notice 'get-modelview-matrix' is
consistently high in the list. Here it is:
(define (get-modelview-matrix)
(let ((bv (make-bytevector (* 16 8))))
(glGetDoublev GL_MODELVIEW_MATRIX bv)
bv))
I could write it like this:
(define get-modelview-matrix
(let ((bv (make-bytevector (* 16 8))))
(lambda ()
(glGetDoublev GL_MODELVIEW_MATRIX bv)
bv)))
That's of course much faster. But, one of the callers of
'get-modelview-matrix' really does need a copy of the matrix. So I
modified the call site as such:
(bytevector-copy (get-modelview-matrix))
and then 'bytevector-copy' shows up high in the list. :-)
So my question is, is the first version of 'get-modelview-matrix' shown
above inherently "hot"?
Ed