gl:tex-image-2d seems a bit slow (~23 sec for a 1k by 1k texture on SBCL 1.0.2 win32), attached patch speeds it up ~100x (to ~0.25 sec).
Problem was that the element type in with-opengl-array wasn't constant (since it had been passed as a parameter to tex-image-2d) so cffi couldn't optimize for a specific type. Patch moves the type check out of the copy loop, and duplicates the loop for each type, so each case can be optimized individually.
-- Bart
On Sat, 6 Oct 2007 23:29:33 -0500 "Bart Botta" 00003b@gmail.com wrote:
gl:tex-image-2d seems a bit slow (~23 sec for a 1k by 1k texture on SBCL 1.0.2 win32), attached patch speeds it up ~100x (to ~0.25 sec).
Very nice! There was some discussion about this on cffi-devel as well in case you don't follow that list.
Sincerely, Mikael Lax
Hello Bart,
Sorry for the late reply.
"Bart Botta" 00003b@gmail.com writes:
gl:tex-image-2d seems a bit slow (~23 sec for a 1k by 1k texture on SBCL 1.0.2 win32), attached patch speeds it up ~100x (to ~0.25 sec).
Cool. Applied, thanks.
cl-opengl-devel@common-lisp.net