[apparmor] [patch 08/13] parser - push normalize_tree() ops into expr-tree classes

Steve Beattie steve at nxnw.org
Thu Oct 10 22:51:04 UTC 2013


On Thu, Oct 10, 2013 at 03:34:53PM -0700, John Johansen wrote:
> On 10/10/2013 01:46 PM, Steve Beattie wrote:
> > This is patch tries to reduce the number of dynamic_cast<>s needed
> > during normalization by pushing the operations of normalize_tree()
> > into the expr-tree classes themselves rather than perform it as
> > an external function. This eliminates the need for dynamic_cast<>
> > checks on the current object under inspection and reduces the number
> > of checks needing to be performed on child Nodes as well.
> > 
> > In non-strict benchmarking, doing the dynamic_cast<> reduction
> > for just the tree normalization operation resulted in a ~10-15%
> > improvement in overall time on a couple of different hosts (amd64,
> > armel), as measured against apparmor_parser -Q.  Valgrind's callgrind
> > tool indicated a reduction in the number of calls to dynamic_cast<>
> > on the tst/simple_tests/vars/dbus_vars_9.sd test profile from ~19
> > million calls to ~12 million.
> > 
> > In comparisons with dumped expr trees over both the entire
> > tst/simple_tests/ tree and from 1000 randomly generated profiles via
> > stress.rb, the generated trees were identical.
> > 
> > Patch history:
> >   v1: initial version of patch
> >   v2: update patch to take into account the infinite loop fix in
> >       trunk rev 1975 and refresh against current code.
> >   v3: no change
> > 
> > Signed-off-by: Steve Beattie <steve at nxnw.org>
> 
> I know I asked you to push this, but please hold off on committing it
> I thought I saw an error last time I you sent it, but I haven't had
> a chance to give it a proper look yet

Sure, that's fine, it'll give me more time to do the review of the
nested alternations parser patch that I still owe for you. :/

-- 
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20131010/8ca6d830/attachment.pgp>


More information about the AppArmor mailing list