Use memcmp for mju_compare if no AVX. 15% faster on Humanoid.

PiperOrigin-RevId: 493324356
Change-Id: I5f71dc1a8ae40c18864ea80f00a5f86ff952f72c
This commit is contained in:
Alessio Quaglino
2022-12-06 09:13:50 -08:00
committed by Copybara-Service
parent 7f459ab8ca
commit 2d304d65e5
3 changed files with 151 additions and 15 deletions
+1 -7
View File
@@ -397,13 +397,7 @@ static int mju_compare(const int* vec1, const int* vec2, int n) {
#endif
// scalar part
for (; i<n; i++) {
if (vec1[i]!=vec2[i]) {
return 0;
}
}
return 1;
return !memcmp(vec1+i, vec2+i, (n-i)*sizeof(int));
}
// combine two sparse vectors: dst = a*dst + b*src, return nnz of result