From: Adam Tkac <atkac@redhat.com>
To: selinux@tycho.nsa.gov
Subject: [PATCH] Two optimizations for libsepol
Date: Fri, 25 May 2012 18:23:32 +0200 [thread overview]
Message-ID: <20120525162331.GA17191@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1169 bytes --]
Hello all,
I've just finished two optimizations which speeds-up libsepol's
expand_filename_trans() function. Various se* commands (like setsebool,
semodule) now consumes only 15% of CPU time compared to current
expand_filename_trans() implementation.
The first patch is fairly simple and straightforward.
The second patch improves main expand_filename_trans() headache, comparsion of
two linked lists. It chunks the second list by filename_trans->stype value and
now algorithm walks only through piece of list where all elements have matching
filename_trans->stype value.
As an example, semodule run time is greatly decreased on my machine:
Original libsepol:
# time /usr/sbin/semodule -b /etc/selinux/targeted/modules/active/base.pp
real 1m54.548s
user 1m51.535s
sys 0m0.875s
After the first patch:
# time /usr/sbin/semodule -b /etc/selinux/targeted/modules/active/base.pp
real 1m43.243s
user 1m40.247s
sys 0m0.902s
Both patches applied:
# time /usr/sbin/semodule -b /etc/selinux/targeted/modules/active/base.pp
real 0m20.752s
user 0m18.508s
sys 0m0.984s
Any comments are welcomed.
Regards, Adam
--
Adam Tkac, Red Hat, Inc.
[-- Attachment #2: 0001-Optimize-expand_filename_trans-function-part1.patch --]
[-- Type: text/plain, Size: 0 bytes --]
reply other threads:[~2012-05-25 16:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120525162331.GA17191@redhat.com \
--to=atkac@redhat.com \
--cc=selinux@tycho.nsa.gov \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.