https://bugs.openldap.org/show_bug.cgi?id=9349
--- Comment #1 from Howard Chu hyc@openldap.org --- (In reply to Gabriel Buades from comment #0)
Taking advantage of the fact, that the values in the old and new attributes are ordered in the same way, I've build a patch to opmtimize this search process.
Now, the same operation takes 0.2 seconds, when it used to take 50s.
This can't be right:
+ for ( i=k=0; i < ap->a_numvals; i++ ) { + char found = 0; + BerValue* current = &ap->a_nvals[i]; + int k2 = k; + for (k2 = k ; k2 < a2->a_numvals; k2 ++) { + int match = -1, rc; + const char *text; + + rc = ordered_value_match( &match, a2, + ap->a_desc->ad_type->sat_equality, 0, + &ap->a_nvals[i], current, &text );
current is the same as &ap->a_nvals[i].