[cffi-devel] Performance of CFFI:PARSE-TYPE

Luís Oliveira luismbo at gmail.com
Fri May 30 17:27:49 UTC 2008


On Fri, May 30, 2008 at 5:13 PM, Hans Hübner <hans at huebner.org> wrote:
>> A few weeks ago, some optimizations to PARSE-TYPE and FOREIGN-ALLOC
>> (which was calling PARSE-TYPE more often than necessary). What's your
>> use case?

Ugh. That should read "some optimizations ... were made".


> Every invocation of FOREIGN-STRING-ALLOC eventually invokes
> PARSE-TYPE, and we use it a lot.

Thanks to the optimization mentioned above (a compiler macro for
foreign-alloc), foreign-string-alloc calls PARSE-TYPE only at
compile-time.

My guess is that the PARSE-TYPE calls you're seeing are coming from
FOREIGN-ENUM-{VALUE,KEYWORD}, which is one of the few places where
calls to PARSE-TYPE at runtime haven't been optimized away into
compile-time, yet. Can you confirm this?

-- 
Luís Oliveira
http://student.dei.uc.pt/~lmoliv/



More information about the cffi-devel mailing list