Re: [eigen] Indexes: why signed instead of unsigned?

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


On 5/17/10, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
> 2010/5/16 leon zadorin <leonleon77@xxxxxxxxx>:
[...]
>> but also for the purposes of speed
>> such as better utilization of CPU cache-lines (esp. for the
>> frequently-used portions of the code).
[...]
>> sizeof(uint_fast32_t) is still 4 (i.e. != sizeof(uint_fast64_t))
>>
>> thereby implying to me that if I am running a 64 bit platform and I
>> *don't* need > 4billion(s) elements in my matricies et al, then using
>> (u)int_fast32_t may be faster/more-efficient (as per vendors
>> evaluation of 'fast') than the implied 64-bit variant...
>
> On x86-64, 64bit integers are really just as fast as 32bit integers. I
> tried benchmarking that to be sure, see attached file a.cpp. Results:
>
> ##### 10:33:12 ~/cuisine$ g++ -O2 a.cpp -o a -I ../eigen-clone/ -lrt
> && ./a 2>/dev/null
> op: add
>   index type of size: 4
>     time: 0.431198
>   index type of size: 8
>     time: 0.430843
[...]

Well ok, but what was the a.cpp testing and making sure of?



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/