Skip to content

Conversation

@rafaelfranca
Copy link
Collaborator

And add tests for it.

@rafaelfranca rafaelfranca requested a review from a team November 19, 2025 18:23

def have_yjit?(ruby)
ruby_version = check_output("#{ruby} -v --yjit", err: File::NULL).strip
ruby_version = `#{ruby} -v --yjit 2> #{File::NULL}`.strip
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not continue using check_output here?

Copy link
Collaborator Author

@rafaelfranca rafaelfranca Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

popen is overkill. It is the same answer as the Process case. Ruby has Kernel#` to do what we want, get the stdout of a subshell. There is no reason to reimplement it using popen

@rafaelfranca rafaelfranca merged commit 32f9e44 into main Nov 20, 2025
3 checks passed
@rafaelfranca rafaelfranca deleted the rmf-cpu-logic branch November 20, 2025 21:11
private

def disable_turbo_boost
# sudo requires the flag '-S' in order to take input from stdin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that it's always been like this but I don't know why we are using -S.

end

def maximize_frequency
# Disabling Turbo Boost reduces the CPU frequency, so this should be run after that.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this comment should actually go in disable_frequency_scaling since that's where the order is important.

end

unless frequency_maximized?
puts("You forgot to set the min perf percentage to 100:")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
puts("You forgot to set the min perf percentage to 100:")
puts("You forgot to set the min perf percentage to #{FREQUENCY_MAXIMIZED_VALUE}:")

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.

4 participants