GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — benchmark,doc: add CPU scaling governor to perf · nodejs/node@68e45b4

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • benchmark
    • cpu.sh
  • doc/contributing
    • writing-and-running-benchmarks.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎benchmark/cpu.sh‎

Copy file name to clipboard
+24Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/sh
2+
3+
CPUPATH=/sys/devices/system/cpu
4+
5+
MAXID=$(cat $CPUPATH/present | awk -F- '{print $NF}')
6+
7+
set_governor() {
8+
echo "Setting CPU frequency governor to \"$1\""
9+
i=0
10+
while [ "$i" -le "$MAXID" ]; do
11+
echo "$1" > "$CPUPATH/cpu$i/cpufreq/scaling_governor"
12+
i=$((i + 1))
13+
done
14+
}
15+
16+
case "$1" in
17+
fast | performance)
18+
set_governor "performance"
19+
;;
20+
*)
21+
echo "Usage: $0 fast"
22+
exit 1
23+
;;
24+
esac
Collapse file

‎doc/contributing/writing-and-running-benchmarks.md‎

Copy file name to clipboardExpand all lines: doc/contributing/writing-and-running-benchmarks.md
+10Lines changed: 10 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,16 @@ A list of mirrors is [located here](https://cran.r-project.org/mirrors.html).
9494

9595
## Running benchmarks
9696

97+
### Setting CPU Frequency scaling governor to "performance"
98+
99+
It is recommended to set the CPU frequency to `performance` before running
100+
benchmarks. This increases the likelihood of each benchmark achieving peak performance
101+
according to the hardware. Therefore, run:
102+
103+
```console
104+
$ ./benchmarks/cpu.sh fast
105+
```
106+
97107
### Running individual benchmarks
98108

99109
This can be useful for debugging a benchmark or doing a quick performance

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.