[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: vectors are something else
From: |
Daniel Hartwig |
Subject: |
Re: vectors are something else |
Date: |
Mon, 15 Apr 2013 22:17:10 +0800 |
On 15 April 2013 22:08, Daniel Llorens <address@hidden> wrote:
>
> On Apr 15, 2013, at 14:28, Daniel Hartwig wrote:
>
>> Is it
>> really much faster to do one or the other:
>>
>> if lbnd != 0: error
>> index = …
>>
>> vs:
>>
>> index = lbnd + ...
>
> The second should actually be just
>
> index = ...
>
> You do this by having the base index point to the element at index 0
> and not to the first element. This is a mistake all through the Guile
> array code.
So lbnd is only for range checking. Neat.
>
> A branch would certainly be slower. However, if the array implementation
> was exposed to the compiler, the lbnd!=0 check could be hoisted out of
> any array loop. So both would end up being identical in that case.
I see.
- Re: vectors are something else, (continued)
Re: vectors are something else, Daniel Llorens, 2013/04/12
Re: vectors are something else, Daniel Llorens, 2013/04/12
Re: vectors are something else, Daniel Llorens, 2013/04/15
Re: vectors are something else, Mark H Weaver, 2013/04/15
Mutable top-level bindings (was: vectors are something else), Chris K. Jester-Young, 2013/04/17
Re: Mutable top-level bindings, Mark H Weaver, 2013/04/17
Re: Mutable top-level bindings, Ian Price, 2013/04/17