MCPcopy Create free account
hub / github.com/nodejs/node / run_benchmark

Function run_benchmark

deps/v8/tools/generate-runtime-call-stats.py:160–244  ·  view source on GitHub ↗
(story,
                  repeats=1,
                  output_dir=".",
                  verbose=False,
                  js_flags=None,
                  browser_args=None,
                  chromium_dir=".",
                  executable=None,
                  benchmark="v8.browsing_desktop",
                  device=None,
                  browser="release")

Source from the content-addressed store, hash-verified

158
159
160def run_benchmark(story,
161 repeats=1,
162 output_dir=".",
163 verbose=False,
164 js_flags=None,
165 browser_args=None,
166 chromium_dir=".",
167 executable=None,
168 benchmark="v8.browsing_desktop",
169 device=None,
170 browser="release"):
171
172 orig_chromium_dir = chromium_dir
173 xvfb = os.path.join(chromium_dir, "testing", "xvfb.py")
174 if not os.path.isfile(xvfb):
175 chromium_dir = os.path(chromium_dir, "src")
176 xvfb = os.path.join(chromium_dir, "testing", "xvfb.py")
177 if not os.path.isfile(xvfb):
178 print(("chromium_dir does not point to a valid chromium checkout: " +
179 orig_chromium_dir))
180 sys.exit(1)
181
182 command = [
183 xvfb,
184 os.path.join(chromium_dir, "tools", "perf", "run_benchmark"),
185 "run",
186 "--story",
187 story,
188 "--pageset-repeat",
189 str(repeats),
190 "--output-dir",
191 output_dir,
192 "--intermediate-dir",
193 os.path.join(output_dir, "artifacts"),
194 benchmark,
195 ]
196
197 if executable:
198 command += ["--browser-executable", executable]
199 else:
200 command += ["--browser", browser]
201
202 if device:
203 command += ["--device", device]
204 if browser_args:
205 command += ["--extra-browser-args", browser_args]
206 if js_flags:
207 command += ["--js-flags", js_flags]
208
209 if not benchmark.startswith("v8."):
210 # Most benchmarks by default don't collect runtime call stats so enable them
211 # manually.
212 categories = [
213 "v8",
214 "disabled-by-default-v8.runtime_stats",
215 ]
216
217 command += ["--extra-chrome-categories", ",".join(categories)]

Callers 1

mainFunction · 0.70

Calls 9

strFunction · 0.85
printFunction · 0.70
closeMethod · 0.65
matchMethod · 0.65
joinMethod · 0.45
pathMethod · 0.45
exitMethod · 0.45
compileMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected