[Date Prev][Date Next] [Chronological] [Thread] [Top]

More about ACL performance



Hi,

during my tests with ACL caching, I found out, that the ad_inlist function is 
much slower than it could be. Each attrs value is first converted into a 
AttributeDescription, than the AttributeType is compared and finally the 
AttributeDescription is thrown away. The following patch just receices the 
AttributeType and compares it.

Is this something for the ITS?

Yours,
Stephan Siano

diff -u -r1.1.1.5 ad.c
--- ad.c        2000/10/05 10:29:09     1.1.1.5
+++ ad.c        2002/01/07 15:08:31
@@ -224,19 +224,13 @@
 {
        int i;
        for( i=0; attrs[i] != NULL; i++ ) {
-               AttributeDescription *ad = NULL;
-               const char *text;
-               int rc;
-
-               rc = slap_str2ad( attrs[i], &ad, &text );
+               AttributeType *at;

-               if( rc != LDAP_SUCCESS ) continue;
+               at = at_find(attrs[i]);

-               rc = is_ad_subtype( desc, ad );
-
-               ad_free( ad, 1 );
-
-               if( rc ) return 1;
+               if (at != NULL && is_at_subtype(desc->ad_type,at)) {
+                       return 1;
+               }
        }

        return 0;

-- 
Stephan Siano                           Mail:  Stephan.Siano@suse.de
SuSE Linux Solutions AG                 Phone: 06196 50951 31
Mergenthalerallee 45-47			Fax:   06196 409607
D-65760 Eschborn