Bug 981022 - [PERF] selinux module should require openshift-origin-common/config instead of openshift-origin-common
Summary: [PERF] selinux module should require openshift-origin-common/config instead o...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Rob Millner
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-03 19:37 UTC by Andy Grimm
Modified: 2016-11-08 03:47 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-07-22 15:20:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Andy Grimm 2013-07-03 19:37:26 UTC
openshift-origin-node/utils/selinux currently requires openshift-origin-common, but it appears to only need that for loading a config object.  Loading all of the requires in openshift-origin-common is expensive, and this translates to slower execution of scripts which should be fast, such as oo-trap-user and oo-get-mcs-level.  For comparison on a fairly idle system:

[agrimm ~]$ time oo-ruby -e 'require "openshift-origin-common"'

real	0m0.773s
user	0m0.344s
sys	0m0.340s
[agrimm ~]$ time oo-ruby -e 'require "openshift-origin-common/config"'

real	0m0.239s
user	0m0.111s
sys	0m0.081s

and on a busier one:

[agrimm lib]$ time oo-ruby -e 'require "openshift-origin-common"'

real	0m3.745s
user	0m0.411s
sys	0m0.511s
[agrimm lib]$ time oo-ruby -e 'require "openshift-origin-common/config"'

real	0m0.546s
user	0m0.133s
sys	0m0.148s

Comment 1 openshift-github-bot 2013-07-09 16:56:42 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/eae448337517199f018f8c38d7c0c159f88f8807
Bug 981022 - only load the parts of common that are needed.

Comment 2 Meng Bo 2013-07-10 05:15:47 UTC
Seems the bug is not easy to verify with normal test scenario.

Checked on devenv_3471, the selinux.rb require opneshift-origin-common/cofing instead of openshift-origin-common now.

#cat openshift-origin-node/utils/selinux.rb
<---->
require 'etc'
require 'selinux'
require 'find'
require 'openshift-origin-common/config'
require 'openshift-origin-node/utils/node_logger'
<---->


Note You need to log in before you can comment on or make changes to this bug.