Re: [eigen] Indexes: why signed instead of unsigned? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Indexes: why signed instead of unsigned?
- From: leon zadorin <leonleon77@xxxxxxxxx>
- Date: Mon, 17 May 2010 02:00:58 +1000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=nT7t2MtMaOXW8KrSxEhX/aWxSAfY6XVA81mZjiwehlc=; b=aES0S8Lgv8rid4Xy6gNGXy1mj0H9WYQI8BtvWKcxSIFz2J4pztwU8fUQmd3Y7OXiGm stAm/ujMJhPH1Dl7E6YYQ2OSnHbSFQyIIeY3KAmgeBILh8weCjtbSIL2RZoRC1nwiX6S pbVWut6a8e0mODn4pxfpP9hwsLwxEDoRNTcgw=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=l4pfyYHhSv/CKjvtU+XQv2iOQqtyLjvEoQPfiErJ787iPAKj/cNQrjNHDg83/SC0Th LdCY0jGSeh0LeL11AaBl0C7Uj/LC02qRaR0py50uu8ENK+xBl11/opKrpoXcd7CL8PZV pZKlJuz/goa2x7Dzw2XEM8voMq91Rd1CW/cFU=
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?