[Xorp-cvs] XORP cvs commit: xorp/policy/common

Andrea Bittau abittau at icir.org
Wed Aug 6 01:11:30 PDT 2008


CVSROOT:	/usr/local/www/data/cvs
Module name:	xorp
Changes by:	abittau at chum.icir.org	2008-08-06 08:11:30 UTC

XORP CVS repository


Modified files:
	policy/common dispatcher.cc dispatcher.hh elem_filter.hh 
	              elem_null.hh elem_set.cc elem_set.hh element.cc 
	              element.hh element_base.cc element_base.hh 
	              operator.cc operator.hh operator_base.hh 

Log message:
	big change, small improvement =(.
	
	Improve operator dispatch speed by ~8%.  There's less overhead when execting
	policies now.  This is a rather hard to measure optimization but in theory it
	should make things faster, especially with large policies.  I got rid of virtual
	methods when computing hashes for determining which callback to call.
	
	before:
	[94% shorty test]# ./policybench -p base -v base.var
	Loading...
	Benchmarking.  Iterations: 100000
	Stats:
	Total time 391 (ms) iterations 100000
	Iterations/s 255754.476
	Instr  1 Avg Time    181.122    ( 4.83%)
	Instr  2 Avg Time    425.527    (11.34%)
	Instr  3 Avg Time    509.471    (13.57%)
	Instr  4 Avg Time    274.458    ( 7.31%)
	Instr  5 Avg Time    253.472    ( 6.75%)
	Instr  6 Avg Time    224.364    ( 5.98%)
	Instr  7 Avg Time   1064.297    (28.35%)
	Instr  8 Avg Time    298.075    ( 7.94%)
	Instr  9 Avg Time    224.821    ( 5.99%)
	Instr 10 Avg Time    297.968    ( 7.94%)
	
	after:
	[99% 04:04 shorty test]# ./policybench -p base -v base.var
	Loading...
	Benchmarking.  Iterations: 100000
	Stats:
	Total time 375 (ms) iterations 100000
	Iterations/s 266666.667
	Instr  1 Avg Time    178.100    ( 5.04%)
	Instr  2 Avg Time    420.234    (11.90%)
	Instr  3 Avg Time    467.342    (13.23%)
	Instr  4 Avg Time    260.643    ( 7.38%)
	Instr  5 Avg Time    251.808    ( 7.13%)
	Instr  6 Avg Time    220.174    ( 6.24%)
	Instr  7 Avg Time   1018.430    (28.84%)
	Instr  8 Avg Time    247.231    ( 7.00%)
	Instr  9 Avg Time    220.372    ( 6.24%)
	Instr 10 Avg Time    246.904    ( 6.99%)
	
	Notice how we saved ~40 cycles when dispatching operators (i.e., Instr 3 and
	Instr 7).  In the case of Instr 3, a rather simple operation (comparing
	prefixes) we get ~8% improvement.

Revision  Changes                                Path
1.16      +3 -42;  commitid: 847548995cae41a7;   xorp/policy/common/dispatcher.cc
1.14      +14 -24;  commitid: 847548995cae41a7;  xorp/policy/common/dispatcher.hh
1.6       +2 -4;  commitid: 847548995cae41a7;    xorp/policy/common/elem_filter.hh
1.9       +3 -6;  commitid: 847548995cae41a7;    xorp/policy/common/elem_null.hh
1.19      +9 -23;  commitid: 847548995cae41a7;   xorp/policy/common/elem_set.cc
1.12      +1 -4;  commitid: 847548995cae41a7;    xorp/policy/common/elem_set.hh
1.14      +17 -17;  commitid: 847548995cae41a7;  xorp/policy/common/element.cc
1.14      +69 -67;  commitid: 847548995cae41a7;  xorp/policy/common/element.hh
1.2       +13 -2;  commitid: 847548995cae41a7;   xorp/policy/common/element_base.cc
1.9       +4 -4;  commitid: 847548995cae41a7;    xorp/policy/common/element_base.hh
1.7       +21 -22;  commitid: 847548995cae41a7;  xorp/policy/common/operator.cc
1.10      +2 -1;  commitid: 847548995cae41a7;    xorp/policy/common/operator.hh
1.8       +40 -21;  commitid: 847548995cae41a7;  xorp/policy/common/operator_base.hh



More information about the Xorp-cvs mailing list