all groups > dotnet compact framework > february 2005 >
You're in the

dotnet compact framework

group:

Int16 vs Int32



Int16 vs Int32 news.austin.rr.com
2/13/2005 8:20:57 PM
dotnet compact framework: Do ARM or XScale chips execute Int16 faster than Int32 or do the 32bit
registers handle Int32 faster?

thanks

Re: Int16 vs Int32 ctacke/
2/14/2005 7:10:15 AM
I've not tested, but intuitively I'd say they'll be the same. The MMU will
align them on a DWORD boundary either way, but speed won't be affected.

-Chris


[quoted text, click to view]

Re: Int16 vs Int32 Alex Feinman [MVP]
2/15/2005 12:27:37 AM
Wouldn't result have to be truncated to 16 bit making it a bit (or maybe 16
bit) slower

--
Alex Feinman
---
Visit http://www.opennetcf.org
[quoted text, click to view]
Re: Int16 vs Int32 ctacke/
2/15/2005 7:13:11 AM
An interesting point - I'm not convinced truncation would have to occur ,
and really this is managed code so I can believe it's significant in any
case. Would be interesting to test though.

-Chris


[quoted text, click to view]

Re: Int16 vs Int32 Sergey Bogdanov
2/15/2005 11:17:00 PM
I have noticed that Int32 is a bit faster than Int16. I had this test
for Int32 measurement:

const int Tries = 1000;
private long Test1Int32()
{
Int32 [] aa2 = new Int32[100001];
long total = 0;
for(int a = 0; a < Tries; a++)
{
long l = OpenNETCF.Win32.Core.QueryPerformanceCounter();
for(int i = 0; i < 100000; i++)
{
aa2[i] = 100;
}
l = OpenNETCF.Win32.Core.QueryPerformanceCounter() - l;
total += l;
}

return total / Tries;
}

and the same test for Int16 array. It seems that "stelem.i2" works
slower than "stelem.i4" and that is why an array with Int16 element is
slower. The same results I had for "Int16Var++" and "Int32Var++" for
this test:

private long Test2Int32()
{
Int32 aa2 = 0;
long total = 0;
for(int a = 0; a < Tries; a++)
{
aa2 = 0;
long l = OpenNETCF.Win32.Core.QueryPerformanceCounter();
for(int i = 0; i < 30000; i++)
{
aa2++;
}
l = OpenNETCF.Win32.Core.QueryPerformanceCounter() - l;
total += l;
}

return total / Tries;
}

Hope this help,
Sergey Bogdanov
http://www.sergeybogdanov.com


[quoted text, click to view]
Re: Int16 vs Int32 news.austin.rr.com
2/18/2005 12:02:39 PM
what chip was the test on?

thanks.

[quoted text, click to view]

Re: Int16 vs Int32 Sergey Bogdanov
2/18/2005 8:21:41 PM
It was tested on ARMv4.

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com


[quoted text, click to view]
AddThis Social Bookmark Button