Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find faster with fewer execs #3821

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Find faster with fewer execs #3821

wants to merge 1 commit into from

Conversation

feld
Copy link

@feld feld commented May 29, 2024

chef-server-ctl reconfigure runs incredibly slow because it has to fork off chmod for every applicable file instead of targeting as many files as possible with a single chmod execution.

Before:

$ time sudo find /opt/cinc-project/embedded/lib/ruby/gems/*/gems -perm /u=x,g=x,o=x -exec chmod 755 {} \;

real    0m5.223s
user    0m0.004s
sys     0m0.006s

$ time sudo find /opt/cinc-project/embedded/lib/ruby/gems/*/gems -perm /u=r,g=r,o=r ! -perm /u=x -exec chmod 644 {} \;

real    0m22.883s
user    0m0.001s
sys     0m0.008s

almost 30 seconds 😭

After:

$  time sudo find /opt/cinc-project/embedded/lib/ruby/gems/*/gems -perm /u=x,g=x,o=x -exec chmod 755 {} \+

real    0m0.177s
user    0m0.006s
sys     0m0.013s

$ time sudo find /opt/cinc-project/embedded/lib/ruby/gems/*/gems -perm /u=r,g=r,o=r ! -perm /u=x -exec chmod 644 {} \+

real    0m0.312s
user    0m0.011s
sys     0m0.001s

about 0.5 seconds...

@feld feld requested review from a team as code owners May 29, 2024 20:41
Copy link

netlify bot commented May 29, 2024

👷 Deploy Preview for chef-server processing.

Name Link
🔨 Latest commit 43f0d59
🔍 Latest deploy log https://app.netlify.com/sites/chef-server/deploys/665792e82054b300080534ab

Copy link

sonarcloud bot commented May 29, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant