[gambit-list] Speed of u8vector-ref

Marc Feeley feeley at iro.umontreal.ca
Tue Oct 27 12:35:12 EDT 2009


On 2009-10-27, at 12:20 PM, Alex Queiroz wrote:

>     I am using these declarations:
>
> (declare
> (safe)
> (block)
> (fixnum)
> (inline-primitives)
> (standard-bindings)
> (extended-bindings)
> (not run-time-bindings))
>
> But I cannot find U32VECTORREF in the code. I see calls to
> S16VECTORREF, though, so probably the former macro has a different
> name?

You need (not safe), otherwise (u32vector-ref v i) will not be  
transformed into (##u32vector-ref v i) which is inlinable and fast.   
If you had used a u8 or u16 primitive, then some inlining would have  
occurred (including the range check for the index).

Marc




More information about the Gambit-list mailing list