size_t for length on x64 will make app slower than on x86?

FrankLike via Digitalmars-d digitalmars-d at puremagic.com
Sun Nov 16 08:02:18 PST 2014


> It means where you have uint x = arr.length you should have had 
> size_t x = arr.length from the very beginning.

I test it :

module aatest;
import std.stdio;
import std.datetime;
import std.conv;
size_t[string] aa;

void ada()
{
	for(size_t i=0;i<1000000;i++)
	{
		aa[to!string(i)] =i;
	}
}
void main()
{
	StopWatch sw;
	sw.start();
	ada();
	sw.stop();
	writeln("\n time is :" , sw.peek().msecs/1000.0," secs");

}
dmd -m64 aatest.d ,and dmd   aatest.d -ofaa32.exe
Result:
m64 :0.553 secs;
m32:0.5 secs;

Thank you all.


More information about the Digitalmars-d mailing list