Wietse Venema:
> To measure [cidr map] initialization overhead, look at the difference between
> 
>     $ time postmap -q /dev/null static:foo
>     $ time postmap -q /dev/null pcre:yourfile
> 
> You will probably have to run this several times to get a meaningful
> result.

The /dev/null can be any string that isn't a valid address. it
causes the pattern matcher to terminate immediately.

> A quick experiment on an old server (i5-650 processor@3.2GHZ) shows
> that it takes 0.15s to parse a 100 thousand patterns. Matching those
> patterns should be much, much, faster.

I can do a little better than thats, and also give a nukber for the
per-query overhead. With this i5-650 CPU @3.2GHZ, it takes 0.92
seconds to parse 1 million IPv4 patterns, and less than about 0.01
second to search through those 1 million IPv4 patterns.

The matching process could be sped up a lot by adding support for
IF/ENDIF as with regexp: and pcre: tables, but it is hard to justify
that effort with current use cases.

        Wietse

Reply via email to