On 10/03/07, thomas weidner 3.14159@gmx.net wrote:
here (sbcl/amd64) a (defun clear (&rest args) ...) is ~15-20 instructions long, no extra function call. the standard keyword based version is ~120 instructions long and calls a generic function. this _IS_ a lot of overhead for such fundamental functions as opengl operations.
You should mention that this only happens if the arguments aren't constant. GL:CLEAR has a compiler macro that removes all that overhead.
If this turns out to be a problem we can also have the enum type accept integers as well and add some operators to get the value of the keywords at compile-time. Then you can play with LOGIOR all you want. :-)
My last thought: what are your points for using keywords? you seem to be really keen on not dropping them; from changing cffi to accept runtime overhead. why?
I'd be in favor of, in addition to the big enum, having restricted enums like we used to so that we get errors (at compile-time usually) when we pass the wrong keyword.
The spec even gives us that info in enum.spec and gl.spec. Not a big priority though.