quickly comparing blocks of ints
- From: "Snis Pilbor" <snispilbor@xxxxxxxxx>
- Date: 26 May 2006 14:56:31 -0700
Hello,
In a time-intensive part of my code, I manually check if two
blocks of ints (of the same size) are identical. I do it in the
straightforward way...
bool compare_int_tables( int *intpointer1, int *intpointer2 )
{
int i;
for ( i = 0; i < size; i++ )
{
if ( intpointer1[i] != intpointer2[i] )
return FALSE;
}
return TRUE;
}
My question is, is there any faster way to do this? I am not very
familiar with what various chips various processors have, but is
checking blocks of generic data like this common enough that it's worth
using a special function from some .h file to do the above in hopes
that the compiler will relegate the work to some super-fast chip, or
something?
Thanks for help with this,
S.P.
.
- Follow-Ups:
- Re: quickly comparing blocks of ints
- From: 3rdtry
- Re: quickly comparing blocks of ints
- From: Logan Shaw
- Re: quickly comparing blocks of ints
- From: moi
- Re: quickly comparing blocks of ints
- From: rossum
- Re: quickly comparing blocks of ints
- From: Jeff Lanam
- Re: quickly comparing blocks of ints
- From: Baxter
- Re: quickly comparing blocks of ints
- From: Jon Harrop
- Re: quickly comparing blocks of ints
- Prev by Date: Re: Is my CS instructor nuts?
- Next by Date: Re: quickly comparing blocks of ints
- Previous by thread: New Software Organization
- Next by thread: Re: quickly comparing blocks of ints
- Index(es):
Relevant Pages
|