From owner-freebsd-net Fri Aug 7 10:18:56 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA11160 for freebsd-net-outgoing; Fri, 7 Aug 1998 10:18:56 -0700 (PDT) (envelope-from owner-freebsd-net@FreeBSD.ORG) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id KAA11155 for ; Fri, 7 Aug 1998 10:18:53 -0700 (PDT) (envelope-from luigi@labinfo.iet.unipi.it) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id RAA15460; Fri, 7 Aug 1998 17:29:30 +0200 From: Luigi Rizzo Message-Id: <199808071529.RAA15460@labinfo.iet.unipi.it> Subject: optimizing ipfw... To: net@FreeBSD.ORG Date: Fri, 7 Aug 1998 17:29:30 +0200 (MET DST) X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi, i was looking at if there is a need to optimize ipfw code, and tried to instrument the code a little bit. It turns out that on a P90, starting from the main loop to the exit point: for (; chain; chain = chain->chain.le_next) { ... } the code takes about 7us on a one-rule (accept) database (including two calls to microtime). Adding 3 not-matching rules (matching src/dst/interface, failing on port number) to the database before the matching one, brings the check time to about 16us per pass, or 3us per rule. Just a data point i guess... i am not so sure on what to optimize, suggestions ? luigi -----------------------------+-------------------------------------- Luigi Rizzo | Dip. di Ingegneria dell'Informazione email: luigi@iet.unipi.it | Universita' di Pisa tel: +39-50-568533 | via Diotisalvi 2, 56126 PISA (Italy) fax: +39-50-568522 | http://www.iet.unipi.it/~luigi/ _____________________________|______________________________________ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message