[augeas-devel] Typecheck benchmark for httpd lens

Francis Giraldeau francis.giraldeau at usherbrooke.ca
Thu Apr 29 04:37:28 UTC 2010


Hi, 

I did some experiments about typechecking of httpd lens. Because of all
sections alternatives that we have to list, the time required to
typecheck the lens rise rapidly. callgrind confirms that the time and
memory hug is in fa_ambig_example. 

I did a script to output httpd.aug lenses with increasing, random
directives of increasing length.  

Increasing the number of directives increases the number of typecheck
performed, while increasing the length of directives names increase
automaton size. 

I added few lines of code to look at what are the checks performed (in
lens.c, ambig_check) : 

    char *f1 = format_info(l1->info);
    char *f2 = format_info(l2->info);
    printf("ambig_check(%s <---> %s)\n", f1, f2);

and it appears that some checks are done in repetition. Here is the
impact of adding a directive of 1 char to the httpd lens. 

$ cat amb2.txt | wc -l 
127
$ cat amb3.txt | wc -l 
153

$ cat amb2.txt | sort | uniq -c | wc -l
33
$ cat amb3.txt | sort | uniq -c | wc -l
33

Then, it would be possible to eliminate one factor by recording the
result of fa_ambig_example in a map, with both lenses as a key, and
reuse the result instead of recomputing it. But, it will not help to
reduce the size of automatons involved...

Have a nice day, 

Francis




More information about the augeas-devel mailing list