Profiling

Perf profiling:

Tools that can be used to generate/ visualise perf results:

  • flamegraph-rs (<https://github.com/flamegraph-rs/flamegraph>)
  • flamescope (<https://github.com/Netflix/flamescope>)

Example using perf on micro_bench_ops and visualising using flamescope:

1. # build `examples/micro_bench_ops`
2. cargo build --release --example micro_bench_ops

4. # run `examples/micro_bench_ops` using perf
5. sudo perf record -F 49 -a -g -- ./target/release/examples/micro_bench_ops
6. sudo perf script --header > micro_bench_ops_perf

8. # now open the file using flamescope

Example running deno_tcp.ts in combination with flamegraph (script.sh):

1. sudo flamegraph -o flamegraph.svg target/debug/deno run --allow-net cli/bench/deno_tcp.ts &
2. sleep 1
3. ./third_party/prebuilt/linux64/wrk http://localhost:4500/
4. sleep 1
5. kill `pgrep perf`

v8 profiling:

Example using v8 profiling on micro_bench_ops:

1. # build `examples/micro_bench_ops`
2. cargo build --release --example micro_bench_ops

4. # run `examples/micro_bench_ops`
5. ./target/release/examples/micro_bench_ops --prof

Example using v8 profiling on deno_tcp.ts:

1. # build `deno`
2. cargo build --release

4. # run `deno_tcp.ts`
5. ./target/release/deno --v8-flags=--prof --allow-net cli/bench/deno_tcp.ts &
6. sleep 1
7. ./third_party/prebuilt/linux64/wrk http://localhost:4500/
8. sleep 1
9. kill `pgrep deno`

V8 will write a file in the current directory that looks like this: isolate-0x7fad98242400-v8.log. To examine this file:

1. node --prof-process isolate-0x7fad98242400-v8.log > prof.log

prof.log will contain information about tick distribution of different calls.

To view the log with Web UI, generate JSON file of the log:

Open rusty_v8/v8/tools/profview/index.html in your browser, and select prof.json to view the distribution graphically.

Useful V8 flags during profiling:

  • —prof
  • —log-internal-timer-events
  • —log-timer-events
  • —track-gc
  • —log-source-code
  • —track-gc-object-stats

To learn more about profiling, check out the following links:

  • <https://v8.dev/docs/profile>

Debugging with LLDB

To debug the deno binary, we can use rust-lldb. It should come with rustc and is a wrapper around LLDB.

1. $ rust-lldb -- ./target/debug/deno run --allow-net tests/http_bench.ts
2. # On macOS, you might get warnings like
3. # `ImportError: cannot import name _remove_dead_weakref`
4. # In that case, use system python by setting PATH, e.g.
5. # PATH=/System/Library/Frameworks/Python.framework/Versions/2.7/bin:$PATH
6. (lldb) command script import "/Users/kevinqian/.rustup/toolchains/1.36.0-x86_64-apple-darwin/lib/rustlib/etc/lldb_rust_formatters.py"
7. (lldb) type summary add --no-value --python-function lldb_rust_formatters.print_val -x ".*" --category Rust
8. (lldb) type category enable Rust
9. (lldb) target create "../deno/target/debug/deno"
10. Current executable set to '../deno/target/debug/deno' (x86_64).
11. (lldb) settings set -- target.run-args  "tests/http_bench.ts" "--allow-net"
12. (lldb) b op_start
13. (lldb) r

V8 flags

V8 has many many internal command-line flags:

``` 1. $ deno run --v8-flags=--help _ 2. SSE3=1 SSSE3=1 SSE4_1=1 SSE4_2=1 SAHF=1 AVX=1 FMA3=1 BMI1=1 BMI2=1 LZCNT=1 POPCNT=1 ATOM=0 3. Synopsis: 4. shell [options] [--shell] [<file>...] 5. d8 [options] [-e <string>] [--shell] [[--module] <file>...]

  1. -e execute a string in V8
  2. --shell run an interactive JavaScript shell
  3. --module execute a file as a JavaScript module

  4. Note: the --module option is implicitly enabled for *.mjs files.

  5. The following syntax for options is accepted (both '-' and '--' are ok):

  6. --flag (bool flags only)
  7. --no-flag (bool flags only)
  8. --flag=value (non-bool flags only, no spaces around '=')
  9. --flag value (non-bool flags only)
  10. -- (captures all remaining args in JavaScript)

  11. Options:

  12. --use-strict (enforce strict mode)
  13. type: bool default: false
  14. --es-staging (enable test-worthy harmony features (for internal use only))
  15. type: bool default: false
  16. --harmony (enable all completed harmony features)
  17. type: bool default: false
  18. --harmony-shipping (enable all shipped harmony features)
  19. type: bool default: true
  20. --harmony-regexp-sequence (enable "RegExp Unicode sequence properties" (in progress))
  21. type: bool default: false
  22. --harmony-weak-refs-with-cleanup-some (enable "harmony weak references with FinalizationRegistry.prototype.cleanupSome" (in progress))
  23. type: bool default: false
  24. --harmony-regexp-match-indices (enable "harmony regexp match indices" (in progress))
  25. type: bool default: false
  26. --harmony-top-level-await (enable "harmony top level await")
  27. type: bool default: false
  28. --harmony-namespace-exports (enable "harmony namespace exports (export * as foo from 'bar')")
  29. type: bool default: true
  30. --harmony-sharedarraybuffer (enable "harmony sharedarraybuffer")
  31. type: bool default: true
  32. --harmony-import-meta (enable "harmony import.meta property")
  33. type: bool default: true
  34. --harmony-dynamic-import (enable "harmony dynamic import")
  35. type: bool default: true
  36. --harmony-promise-all-settled (enable "harmony Promise.allSettled")
  37. type: bool default: true
  38. --harmony-promise-any (enable "harmony Promise.any")
  39. type: bool default: true
  40. --harmony-private-methods (enable "harmony private methods in class literals")
  41. type: bool default: true
  42. --harmony-weak-refs (enable "harmony weak references")
  43. type: bool default: true
  44. --harmony-string-replaceall (enable "harmony String.prototype.replaceAll")
  45. type: bool default: true
  46. --harmony-logical-assignment (enable "harmony logical assignment")
  47. type: bool default: true
  48. --lite-mode (enables trade-off of performance for memory savings)
  49. type: bool default: false
  50. --future (Implies all staged features that we want to ship in the not-too-far future)
  51. type: bool default: false
  52. --assert-types (generate runtime type assertions to test the typer)
  53. type: bool default: false
  54. --allocation-site-pretenuring (pretenure with allocation sites)
  55. type: bool default: true
  56. --page-promotion (promote pages based on utilization)
  57. type: bool default: true
  58. --always-promote-young-mc (always promote young objects during mark-compact)
  59. type: bool default: true
  60. --page-promotion-threshold (min percentage of live bytes on a page to enable fast evacuation)
  61. type: int default: 70
  62. --trace-pretenuring (trace pretenuring decisions of HAllocate instructions)
  63. type: bool default: false
  64. --trace-pretenuring-statistics (trace allocation site pretenuring statistics)
  65. type: bool default: false
  66. --track-fields (track fields with only smi values)
  67. type: bool default: true
  68. --track-double-fields (track fields with double values)
  69. type: bool default: true
  70. --track-heap-object-fields (track fields with heap values)
  71. type: bool default: true
  72. --track-computed-fields (track computed boilerplate fields)
  73. type: bool default: true
  74. --track-field-types (track field types)
  75. type: bool default: true
  76. --trace-block-coverage (trace collected block coverage information)
  77. type: bool default: false
  78. --trace-protector-invalidation (trace protector cell invalidations)
  79. type: bool default: false
  80. --feedback-normalization (feed back normalization to constructors)
  81. type: bool default: false
  82. --enable-one-shot-optimization (Enable size optimizations for the code that will only be executed once)
  83. type: bool default: false
  84. --unbox-double-arrays (automatically unbox arrays of doubles)
  85. type: bool default: true
  86. --interrupt-budget (interrupt budget which should be used for the profiler counter)
  87. type: int default: 147456
  88. --jitless (Disable runtime allocation of executable memory.)
  89. type: bool default: false
  90. --use-ic (use inline caching)
  91. type: bool default: true
  92. --budget-for-feedback-vector-allocation (The budget in amount of bytecode executed by a function before we decide to allocate feedback vectors)
  93. type: int default: 1024
  94. --lazy-feedback-allocation (Allocate feedback vectors lazily)
  95. type: bool default: true
  96. --ignition-elide-noneffectful-bytecodes (elide bytecodes which won't have any external effect)
  97. type: bool default: true
  98. --ignition-reo (use ignition register equivalence optimizer)
  99. type: bool default: true
  100. --ignition-filter-expression-positions (filter expression positions before the bytecode pipeline)
  101. type: bool default: true
  102. --ignition-share-named-property-feedback (share feedback slots when loading the same named property from the same object)
  103. type: bool default: true
  104. --print-bytecode (print bytecode generated by ignition interpreter)
  105. type: bool default: false
  106. --enable-lazy-source-positions (skip generating source positions during initial compile but regenerate when actually required)
  107. type: bool default: true
  108. --stress-lazy-source-positions (collect lazy source positions immediately after lazy compile)
  109. type: bool default: false
  110. --print-bytecode-filter (filter for selecting which functions to print bytecode)
  111. type: string default: *
  112. --trace-ignition-codegen (trace the codegen of ignition interpreter bytecode handlers)
  113. type: bool default: false
  114. --trace-ignition-dispatches (traces the dispatches to bytecode handlers by the ignition interpreter)
  115. type: bool default: false
  116. --trace-ignition-dispatches-output-file (the file to which the bytecode handler dispatch table is written (by default, the table is not written to a file))
  117. type: string default: nullptr
  118. --fast-math (faster (but maybe less accurate) math functions)
  119. type: bool default: true
  120. --trace-track-allocation-sites (trace the tracking of allocation sites)
  121. type: bool default: false
  122. --trace-migration (trace object migration)
  123. type: bool default: false
  124. --trace-generalization (trace map generalization)
  125. type: bool default: false
  126. --turboprop (enable experimental turboprop mid-tier compiler.)
  127. type: bool default: false
  128. --concurrent-recompilation (optimizing hot functions asynchronously on a separate thread)
  129. type: bool default: true
  130. --trace-concurrent-recompilation (track concurrent recompilation)
  131. type: bool default: false
  132. --concurrent-recompilation-queue-length (the length of the concurrent compilation queue)
  133. type: int default: 8
  134. --concurrent-recompilation-delay (artificial compilation delay in ms)
  135. type: int default: 0
  136. --block-concurrent-recompilation (block queued jobs until released)
  137. type: bool default: false
  138. --concurrent-inlining (run optimizing compiler's inlining phase on a separate thread)
  139. type: bool default: false
  140. --max-serializer-nesting (maximum levels for nesting child serializers)
  141. type: int default: 25
  142. --trace-heap-broker-verbose (trace the heap broker verbosely (all reports))
  143. type: bool default: false
  144. --trace-heap-broker-memory (trace the heap broker memory (refs analysis and zone numbers))
  145. type: bool default: false
  146. --trace-heap-broker (trace the heap broker (reports on missing data only))
  147. type: bool default: false
  148. --stress-runs (number of stress runs)
  149. type: int default: 0
  150. --deopt-every-n-times (deoptimize every n times a deopt point is passed)
  151. type: int default: 0
  152. --print-deopt-stress (print number of possible deopt points)
  153. type: bool default: false
  154. --opt (use adaptive optimizations)
  155. type: bool default: true
  156. --turbo-sp-frame-access (use stack pointer-relative access to frame wherever possible)
  157. type: bool default: false
  158. --turbo-control-flow-aware-allocation (consider control flow while allocating registers)
  159. type: bool default: true
  160. --turbo-filter (optimization filter for TurboFan compiler)
  161. type: string default: *
  162. --trace-turbo (trace generated TurboFan IR)
  163. type: bool default: false
  164. --trace-turbo-path (directory to dump generated TurboFan IR to)
  165. type: string default: nullptr
  166. --trace-turbo-filter (filter for tracing turbofan compilation)
  167. type: string default: *
  168. --trace-turbo-graph (trace generated TurboFan graphs)
  169. type: bool default: false
  170. --trace-turbo-scheduled (trace TurboFan IR with schedule)
  171. type: bool default: false
  172. --trace-turbo-cfg-file (trace turbo cfg graph (for C1 visualizer) to a given file name)
  173. type: string default: nullptr
  174. --trace-turbo-types (trace TurboFan's types)
  175. type: bool default: true
  176. --trace-turbo-scheduler (trace TurboFan's scheduler)
  177. type: bool default: false
  178. --trace-turbo-reduction (trace TurboFan's various reducers)
  179. type: bool default: false
  180. --trace-turbo-trimming (trace TurboFan's graph trimmer)
  181. type: bool default: false
  182. --trace-turbo-jt (trace TurboFan's jump threading)
  183. type: bool default: false
  184. --trace-turbo-ceq (trace TurboFan's control equivalence)
  185. type: bool default: false
  186. --trace-turbo-loop (trace TurboFan's loop optimizations)
  187. type: bool default: false
  188. --trace-turbo-alloc (trace TurboFan's register allocator)
  189. type: bool default: false
  190. --trace-all-uses (trace all use positions)
  191. type: bool default: false
  192. --trace-representation (trace representation types)
  193. type: bool default: false
  194. --turbo-verify (verify TurboFan graphs at each phase)
  195. type: bool default: false
  196. --turbo-verify-machine-graph (verify TurboFan machine graph before instruction selection)
  197. type: string default: nullptr
  198. --trace-verify-csa (trace code stubs verification)
  199. type: bool default: false
  200. --csa-trap-on-node (trigger break point when a node with given id is created in given stub. The format is: StubName,NodeId)
  201. type: string default: nullptr
  202. --turbo-stats (print TurboFan statistics)
  203. type: bool default: false
  204. --turbo-stats-nvp (print TurboFan statistics in machine-readable format)
  205. type: bool default: false
  206. --turbo-stats-wasm (print TurboFan statistics of wasm compilations)
  207. type: bool default: false
  208. --turbo-splitting (split nodes during scheduling in TurboFan)
  209. type: bool default: true
  210. --function-context-specialization (enable function context specialization in TurboFan)
  211. type: bool default: false
  212. --turbo-inlining (enable inlining in TurboFan)
  213. type: bool default: true
  214. --max-inlined-bytecode-size (maximum size of bytecode for a single inlining)
  215. type: int default: 500
  216. --max-inlined-bytecode-size-cumulative (maximum cumulative size of bytecode considered for inlining)
  217. type: int default: 1000
  218. --max-inlined-bytecode-size-absolute (maximum cumulative size of bytecode considered for inlining)
  219. type: int default: 5000
  220. --reserve-inline-budget-scale-factor (maximum cumulative size of bytecode considered for inlining)
  221. type: float default: 1.2
  222. --max-inlined-bytecode-size-small (maximum size of bytecode considered for small function inlining)
  223. type: int default: 30
  224. --max-optimized-bytecode-size (maximum bytecode size to be considered for optimization; too high values may cause the compiler to hit (release) assertions)
  225. type: int default: 61440
  226. --min-inlining-frequency (minimum frequency for inlining)
  227. type: float default: 0.15
  228. --polymorphic-inlining (polymorphic inlining)
  229. type: bool default: true
  230. --stress-inline (set high thresholds for inlining to inline as much as possible)
  231. type: bool default: false
  232. --trace-turbo-inlining (trace TurboFan inlining)
  233. type: bool default: false
  234. --turbo-inline-array-builtins (inline array builtins in TurboFan code)
  235. type: bool default: true
  236. --use-osr (use on-stack replacement)
  237. type: bool default: true
  238. --trace-osr (trace on-stack replacement)
  239. type: bool default: false
  240. --analyze-environment-liveness (analyze liveness of environment slots and zap dead values)
  241. type: bool default: true
  242. --trace-environment-liveness (trace liveness of local variable slots)
  243. type: bool default: false
  244. --turbo-load-elimination (enable load elimination in TurboFan)
  245. type: bool default: true
  246. --trace-turbo-load-elimination (trace TurboFan load elimination)
  247. type: bool default: false
  248. --turbo-profiling (enable basic block profiling in TurboFan)
  249. type: bool default: false
  250. --turbo-profiling-verbose (enable basic block profiling in TurboFan, and include each function's schedule and disassembly in the output)
  251. type: bool default: false
  252. --turbo-verify-allocation (verify register allocation in TurboFan)
  253. type: bool default: false
  254. --turbo-move-optimization (optimize gap moves in TurboFan)
  255. type: bool default: true
  256. --turbo-jt (enable jump threading in TurboFan)
  257. type: bool default: true
  258. --turbo-loop-peeling (Turbofan loop peeling)
  259. type: bool default: true
  260. --turbo-loop-variable (Turbofan loop variable optimization)
  261. type: bool default: true
  262. --turbo-loop-rotation (Turbofan loop rotation)
  263. type: bool default: true
  264. --turbo-cf-optimization (optimize control flow in TurboFan)
  265. type: bool default: true
  266. --turbo-escape (enable escape analysis)
  267. type: bool default: true
  268. --turbo-allocation-folding (Turbofan allocation folding)
  269. type: bool default: true
  270. --turbo-instruction-scheduling (enable instruction scheduling in TurboFan)
  271. type: bool default: false
  272. --turbo-stress-instruction-scheduling (randomly schedule instructions to stress dependency tracking)
  273. type: bool default: false
  274. --turbo-store-elimination (enable store-store elimination in TurboFan)
  275. type: bool default: true
  276. --trace-store-elimination (trace store elimination)
  277. type: bool default: false
  278. --turbo-rewrite-far-jumps (rewrite far to near jumps (ia32,x64))
  279. type: bool default: true
  280. --stress-gc-during-compilation (simulate GC/compiler thread race related to https://crbug.com/v8/8520)
  281. type: bool default: false
  282. --turbo-fast-api-calls (enable fast API calls from TurboFan)
  283. type: bool default: false
  284. --reuse-opt-code-count (don't discard optimized code for the specified number of deopts.)
  285. type: int default: 0
  286. --turbo-nci (enable experimental native context independent code.)
  287. type: bool default: false
  288. --turbo-nci-as-highest-tier (replace default TF with NCI code as the highest tier for testing purposes.)
  289. type: bool default: false
  290. --print-nci-code (print native context independent code.)
  291. type: bool default: false
  292. --trace-turbo-nci (trace native context independent code.)
  293. type: bool default: false
  294. --turbo-collect-feedback-in-generic-lowering (enable experimental feedback collection in generic lowering.)
  295. type: bool default: false
  296. --optimize-for-size (Enables optimizations which favor memory size over execution speed)
  297. type: bool default: false
  298. --untrusted-code-mitigations (Enable mitigations for executing untrusted code)
  299. type: bool default: false
  300. --expose-wasm (expose wasm interface to JavaScript)
  301. type: bool default: true
  302. --assume-asmjs-origin (force wasm decoder to assume input is internal asm-wasm format)
  303. type: bool default: false
  304. --wasm-num-compilation-tasks (maximum number of parallel compilation tasks for wasm)
  305. type: int default: 128
  306. --wasm-write-protect-code-memory (write protect code memory on the wasm native heap)
  307. type: bool default: false
  308. --wasm-async-compilation (enable actual asynchronous compilation for WebAssembly.compile)
  309. type: bool default: true
  310. --wasm-test-streaming (use streaming compilation instead of async compilation for tests)
  311. type: bool default: false
  312. --wasm-max-mem-pages (maximum initial number of 64KiB memory pages of a wasm instance)
  313. type: uint default: 32767
  314. --wasm-max-mem-pages-growth (maximum number of 64KiB pages a Wasm memory can grow to)
  315. type: uint default: 65536
  316. --wasm-max-table-size (maximum table size of a wasm instance)
  317. type: uint default: 10000000
  318. --wasm-max-code-space (maximum committed code space for wasm (in MB))
  319. type: uint default: 1024
  320. --wasm-tier-up (enable tier up to the optimizing compiler (requires --liftoff to have an effect))
  321. type: bool default: true
  322. --trace-wasm-ast-start (start function for wasm AST trace (inclusive))
  323. type: int default: 0
  324. --trace-wasm-ast-end (end function for wasm AST trace (exclusive))
  325. type: int default: 0
  326. --liftoff (enable Liftoff, the baseline compiler for WebAssembly)
  327. type: bool default: true
  328. --trace-wasm-memory (print all memory updates performed in wasm code)
  329. type: bool default: false
  330. --wasm-tier-mask-for-testing (bitmask of functions to compile with TurboFan instead of Liftoff)
  331. type: int default: 0
  332. --wasm-expose-debug-eval (Expose wasm evaluator support on the CDP)
  333. type: bool default: false
  334. --validate-asm (validate asm.js modules before compiling)
  335. type: bool default: true
  336. --suppress-asm-messages (don't emit asm.js related messages (for golden file testing))
  337. type: bool default: false
  338. --trace-asm-time (log asm.js timing info to the console)
  339. type: bool default: false
  340. --trace-asm-scanner (log tokens encountered by asm.js scanner)
  341. type: bool default: false
  342. --trace-asm-parser (verbose logging of asm.js parse failures)
  343. type: bool default: false
  344. --stress-validate-asm (try to validate everything as asm.js)
  345. type: bool default: false
  346. --dump-wasm-module-path (directory to dump wasm modules to)
  347. type: string default: nullptr
  348. --experimental-wasm-eh (enable prototype exception handling opcodes for wasm)
  349. type: bool default: false
  350. --experimental-wasm-simd (enable prototype SIMD opcodes for wasm)
  351. type: bool default: false
  352. --experimental-wasm-return-call (enable prototype return call opcodes for wasm)
  353. type: bool default: false
  354. --experimental-wasm-compilation-hints (enable prototype compilation hints section for wasm)
  355. type: bool default: false
  356. --experimental-wasm-gc (enable prototype garbage collection for wasm)
  357. type: bool default: false
  358. --experimental-wasm-typed-funcref (enable prototype typed function references for wasm)
  359. type: bool default: false
  360. --experimental-wasm-reftypes (enable prototype reference type opcodes for wasm)
  361. type: bool default: false
  362. --experimental-wasm-threads (enable prototype thread opcodes for wasm)
  363. type: bool default: false
  364. --experimental-wasm-type-reflection (enable prototype wasm type reflection in JS for wasm)
  365. type: bool default: false
  366. --experimental-wasm-bigint (enable prototype JS BigInt support for wasm)
  367. type: bool default: true
  368. --experimental-wasm-bulk-memory (enable prototype bulk memory opcodes for wasm)
  369. type: bool default: true
  370. --experimental-wasm-mv (enable prototype multi-value support for wasm)
  371. type: bool default: true
  372. --wasm-staging (enable staged wasm features)
  373. type: bool default: false
  374. --wasm-opt (enable wasm optimization)
  375. type: bool default: false
  376. --wasm-bounds-checks (enable bounds checks (disable for performance testing only))
  377. type: bool default: true
  378. --wasm-stack-checks (enable stack checks (disable for performance testing only))
  379. type: bool default: true
  380. --wasm-math-intrinsics (intrinsify some Math imports into wasm)
  381. type: bool default: true
  382. --wasm-trap-handler (use signal handlers to catch out of bounds memory access in wasm (currently Linux x86_64 only))
  383. type: bool default: true
  384. --wasm-fuzzer-gen-test (generate a test case when running a wasm fuzzer)
  385. type: bool default: false
  386. --print-wasm-code (Print WebAssembly code)
  387. type: bool default: false
  388. --print-wasm-stub-code (Print WebAssembly stub code)
  389. type: bool default: false
  390. --asm-wasm-lazy-compilation (enable lazy compilation for asm-wasm modules)
  391. type: bool default: false
  392. --wasm-lazy-compilation (enable lazy compilation for all wasm modules)
  393. type: bool default: false
  394. --wasm-lazy-validation (enable lazy validation for lazily compiled wasm functions)
  395. type: bool default: false
  396. --wasm-atomics-on-non-shared-memory (allow atomic operations on non-shared WebAssembly memory)
  397. type: bool default: true
  398. --wasm-grow-shared-memory (allow growing shared WebAssembly memory objects)
  399. type: bool default: true
  400. --wasm-simd-post-mvp (allow experimental SIMD operations for prototyping that are not included in the current proposal)
  401. type: bool default: false
  402. --wasm-code-gc (enable garbage collection of wasm code)
  403. type: bool default: true
  404. --trace-wasm-code-gc (trace garbage collection of wasm code)
  405. type: bool default: false
  406. --stress-wasm-code-gc (stress test garbage collection of wasm code)
  407. type: bool default: false
  408. --wasm-max-initial-code-space-reservation (maximum size of the initial wasm code space reservation (in MB))
  409. type: int default: 0
  410. --frame-count (number of stack frames inspected by the profiler)
  411. type: int default: 1
  412. --stress-sampling-allocation-profiler (Enables sampling allocation profiler with X as a sample interval)
  413. type: int default: 0
  414. --lazy-new-space-shrinking (Enables the lazy new space shrinking strategy)
  415. type: bool default: false
  416. --min-semi-space-size (min size of a semi-space (in MBytes), the new space consists of two semi-spaces)
  417. type: size_t default: 0
  418. --max-semi-space-size (max size of a semi-space (in MBytes), the new space consists of two semi-spaces)
  419. type: size_t default: 0
  420. --semi-space-growth-factor (factor by which to grow the new space)
  421. type: int default: 2
  422. --max-old-space-size (max size of the old space (in Mbytes))
  423. type: size_t default: 0
  424. --max-heap-size (max size of the heap (in Mbytes) both max_semi_space_size and max_old_space_size take precedence. All three flags cannot be specified at the same time.)
  425. type: size_t default: 0
  426. --initial-heap-size (initial size of the heap (in Mbytes))
  427. type: size_t default: 0
  428. --huge-max-old-generation-size (Increase max size of the old space to 4 GB for x64 systems withthe physical memory bigger than 16 GB)
  429. type: bool default: true
  430. --initial-old-space-size (initial old space size (in Mbytes))
  431. type: size_t default: 0
  432. --global-gc-scheduling (enable GC scheduling based on global memory)
  433. type: bool default: true
  434. --gc-global (always perform global GCs)
  435. type: bool default: false
  436. --random-gc-interval (Collect garbage after random(0, X) allocations. It overrides gc_interval.)
  437. type: int default: 0
  438. --gc-interval (garbage collect after <n> allocations)
  439. type: int default: -1
  440. --retain-maps-for-n-gc (keeps maps alive for <n> old space garbage collections)
  441. type: int default: 2
  442. --trace-gc (print one trace line following each garbage collection)
  443. type: bool default: false
  444. --trace-gc-nvp (print one detailed trace line in name=value format after each garbage collection)
  445. type: bool default: false
  446. --trace-gc-ignore-scavenger (do not print trace line after scavenger collection)
  447. type: bool default: false
  448. --trace-idle-notification (print one trace line following each idle notification)
  449. type: bool default: false
  450. --trace-idle-notification-verbose (prints the heap state used by the idle notification)
  451. type: bool default: false
  452. --trace-gc-verbose (print more details following each garbage collection)
  453. type: bool default: false
  454. --trace-gc-freelists (prints details of each freelist before and after each major garbage collection)
  455. type: bool default: false
  456. --trace-gc-freelists-verbose (prints details of freelists of each page before and after each major garbage collection)
  457. type: bool default: false
  458. --trace-evacuation-candidates (Show statistics about the pages evacuation by the compaction)
  459. type: bool default: false
  460. --trace-allocations-origins (Show statistics about the origins of allocations. Combine with --no-inline-new to track allocations from generated code)
  461. type: bool default: false
  462. --trace-allocation-stack-interval (print stack trace after <n> free-list allocations)
  463. type: int default: -1
  464. --trace-duplicate-threshold-kb (print duplicate objects in the heap if their size is more than given threshold)
  465. type: int default: 0
  466. --trace-fragmentation (report fragmentation for old space)
  467. type: bool default: false
  468. --trace-fragmentation-verbose (report fragmentation for old space (detailed))
  469. type: bool default: false
  470. --minor-mc-trace-fragmentation (trace fragmentation after marking)
  471. type: bool default: false
  472. --trace-evacuation (report evacuation statistics)
  473. type: bool default: false
  474. --trace-mutator-utilization (print mutator utilization, allocation speed, gc speed)
  475. type: bool default: false
  476. --incremental-marking (use incremental marking)
  477. type: bool default: true
  478. --incremental-marking-wrappers (use incremental marking for marking wrappers)
  479. type: bool default: true
  480. --incremental-marking-task (use tasks for incremental marking)
  481. type: bool default: true
  482. --incremental-marking-soft-trigger (threshold for starting incremental marking via a task in percent of available space: limit - size)
  483. type: int default: 0
  484. --incremental-marking-hard-trigger (threshold for starting incremental marking immediately in percent of available space: limit - size)
  485. type: int default: 0
  486. --trace-unmapper (Trace the unmapping)
  487. type: bool default: false
  488. --parallel-scavenge (parallel scavenge)
  489. type: bool default: true
  490. --scavenge-task (schedule scavenge tasks)
  491. type: bool default: true
  492. --scavenge-task-trigger (scavenge task trigger in percent of the current heap limit)
  493. type: int default: 80
  494. --scavenge-separate-stack-scanning (use a separate phase for stack scanning in scavenge)
  495. type: bool default: false
  496. --trace-parallel-scavenge (trace parallel scavenge)
  497. type: bool default: false
  498. --write-protect-code-memory (write protect code memory)
  499. type: bool default: true
  500. --concurrent-marking (use concurrent marking)
  501. type: bool default: true
  502. --concurrent-array-buffer-sweeping (concurrently sweep array buffers)
  503. type: bool default: true
  504. --concurrent-allocation (concurrently allocate in old space)
  505. type: bool default: false
  506. --local-heaps (allow heap access from background tasks)
  507. type: bool default: false
  508. --stress-concurrent-allocation (start background threads that allocate memory)
  509. type: bool default: false
  510. --parallel-marking (use parallel marking in atomic pause)
  511. type: bool default: true
  512. --ephemeron-fixpoint-iterations (number of fixpoint iterations it takes to switch to linear ephemeron algorithm)
  513. type: int default: 10
  514. --trace-concurrent-marking (trace concurrent marking)
  515. type: bool default: false
  516. --concurrent-store-buffer (use concurrent store buffer processing)
  517. type: bool default: true
  518. --concurrent-sweeping (use concurrent sweeping)
  519. type: bool default: true
  520. --parallel-compaction (use parallel compaction)
  521. type: bool default: true
  522. --parallel-pointer-update (use parallel pointer update during compaction)
  523. type: bool default: true
  524. --detect-ineffective-gcs-near-heap-limit (trigger out-of-memory failure to avoid GC storm near heap limit)
  525. type: bool default: true
  526. --trace-incremental-marking (trace progress of the incremental marking)
  527. type: bool default: false
  528. --trace-stress-marking (trace stress marking progress)
  529. type: bool default: false
  530. --trace-stress-scavenge (trace stress scavenge progress)
  531. type: bool default: false
  532. --track-gc-object-stats (track object counts and memory usage)
  533. type: bool default: false
  534. --trace-gc-object-stats (trace object counts and memory usage)
  535. type: bool default: false
  536. --trace-zone-stats (trace zone memory usage)
  537. type: bool default: false
  538. --zone-stats-tolerance (report a tick only when allocated zone memory changes by this amount)
  539. type: size_t default: 1048576
  540. --track-retaining-path (enable support for tracking retaining path)
  541. type: bool default: false
  542. --concurrent-array-buffer-freeing (free array buffer allocations on a background thread)
  543. type: bool default: true
  544. --gc-stats (Used by tracing internally to enable gc statistics)
  545. type: int default: 0
  546. --track-detached-contexts (track native contexts that are expected to be garbage collected)
  547. type: bool default: true
  548. --trace-detached-contexts (trace native contexts that are expected to be garbage collected)
  549. type: bool default: false
  550. --move-object-start (enable moving of object starts)
  551. type: bool default: true
  552. --memory-reducer (use memory reducer)
  553. type: bool default: true
  554. --memory-reducer-for-small-heaps (use memory reducer for small heaps)
  555. type: bool default: true
  556. --heap-growing-percent (specifies heap growing factor as (1 + heap_growing_percent/100))
  557. type: int default: 0
  558. --v8-os-page-size (override OS page size (in KBytes))
  559. type: int default: 0
  560. --always-compact (Perform compaction on every full GC)
  561. type: bool default: false
  562. --never-compact (Never perform compaction on full GC - testing only)
  563. type: bool default: false
  564. --compact-code-space (Compact code space on full collections)
  565. type: bool default: true
  566. --flush-bytecode (flush of bytecode when it has not been executed recently)
  567. type: bool default: true
  568. --stress-flush-bytecode (stress bytecode flushing)
  569. type: bool default: false
  570. --use-marking-progress-bar (Use a progress bar to scan large objects in increments when incremental marking is active.)
  571. type: bool default: true
  572. --stress-per-context-marking-worklist (Use per-context worklist for marking)
  573. type: bool default: false
  574. --force-marking-deque-overflows (force overflows of marking deque by reducing it's size to 64 words)
  575. type: bool default: false
  576. --stress-compaction (stress the GC compactor to flush out bugs (implies --force_marking_deque_overflows))
  577. type: bool default: false
  578. --stress-compaction-random (Stress GC compaction by selecting random percent of pages as evacuation candidates. It overrides stress_compaction.)
  579. type: bool default: false
  580. --stress-incremental-marking (force incremental marking for small heaps and run it more often)
  581. type: bool default: false
  582. --fuzzer-gc-analysis (prints number of allocations and enables analysis mode for gc fuzz testing, e.g. --stress-marking, --stress-scavenge)
  583. type: bool default: false
  584. --stress-marking (force marking at random points between 0 and X (inclusive) percent of the regular marking start limit)
  585. type: int default: 0
  586. --stress-scavenge (force scavenge at random points between 0 and X (inclusive) percent of the new space capacity)
  587. type: int default: 0
  588. --gc-experiment-background-schedule (new background GC schedule heuristics)
  589. type: bool default: false
  590. --gc-experiment-less-compaction (less compaction in non-memory reducing mode)
  591. type: bool default: false
  592. --disable-abortjs (disables AbortJS runtime function)
  593. type: bool default: false
  594. --randomize-all-allocations (randomize virtual memory reservations by ignoring any hints passed when allocating pages)
  595. type: bool default: false
  596. --manual-evacuation-candidates-selection (Test mode only flag. It allows an unit test to select evacuation candidates pages (requires --stress_compaction).)
  597. type: bool default: false
  598. --fast-promotion-new-space (fast promote new space on high survival rates)
  599. type: bool default: false
  600. --clear-free-memory (initialize free memory with 0)
  601. type: bool default: false
  602. --young-generation-large-objects (allocates large objects by default in the young generation large object space)
  603. type: bool default: true
  604. --debug-code (generate extra code (assertions) for debugging)
  605. type: bool default: false
  606. --code-comments (emit comments in code disassembly; for more readable source positions you should add --no-concurrent_recompilation)
  607. type: bool default: false
  608. --enable-sse3 (enable use of SSE3 instructions if available)
  609. type: bool default: true
  610. --enable-ssse3 (enable use of SSSE3 instructions if available)
  611. type: bool default: true
  612. --enable-sse4-1 (enable use of SSE4.1 instructions if available)
  613. type: bool default: true
  614. --enable-sse4-2 (enable use of SSE4.2 instructions if available)
  615. type: bool default: true
  616. --enable-sahf (enable use of SAHF instruction if available (X64 only))
  617. type: bool default: true
  618. --enable-avx (enable use of AVX instructions if available)
  619. type: bool default: true
  620. --enable-fma3 (enable use of FMA3 instructions if available)
  621. type: bool default: true
  622. --enable-bmi1 (enable use of BMI1 instructions if available)
  623. type: bool default: true
  624. --enable-bmi2 (enable use of BMI2 instructions if available)
  625. type: bool default: true
  626. --enable-lzcnt (enable use of LZCNT instruction if available)
  627. type: bool default: true
  628. --enable-popcnt (enable use of POPCNT instruction if available)
  629. type: bool default: true
  630. --arm-arch (generate instructions for the selected ARM architecture if available: armv6, armv7, armv7+sudiv or armv8)
  631. type: string default: armv8
  632. --force-long-branches (force all emitted branches to be in long mode (MIPS/PPC only))
  633. type: bool default: false
  634. --mcpu (enable optimization for specific cpu)
  635. type: string default: auto
  636. --partial-constant-pool (enable use of partial constant pools (X64 only))
  637. type: bool default: true
  638. --sim-arm64-optional-features (enable optional features on the simulator for testing: none or all)
  639. type: string default: none
  640. --enable-source-at-csa-bind (Include source information in the binary at CSA bind locations.)
  641. type: bool default: false
  642. --enable-armv7 (deprecated (use --arm_arch instead))
  643. type: maybe_bool default: unset
  644. --enable-vfp3 (deprecated (use --arm_arch instead))
  645. type: maybe_bool default: unset
  646. --enable-32dregs (deprecated (use --arm_arch instead))
  647. type: maybe_bool default: unset
  648. --enable-neon (deprecated (use --arm_arch instead))
  649. type: maybe_bool default: unset
  650. --enable-sudiv (deprecated (use --arm_arch instead))
  651. type: maybe_bool default: unset
  652. --enable-armv8 (deprecated (use --arm_arch instead))
  653. type: maybe_bool default: unset
  654. --enable-regexp-unaligned-accesses (enable unaligned accesses for the regexp engine)
  655. type: bool default: true
  656. --script-streaming (enable parsing on background)
  657. type: bool default: true
  658. --stress-background-compile (stress test parsing on background)
  659. type: bool default: false
  660. --finalize-streaming-on-background (perform the script streaming finalization on the background thread)
  661. type: bool default: false
  662. --disable-old-api-accessors (Disable old-style API accessors whose setters trigger through the prototype chain)
  663. type: bool default: false
  664. --expose-gc (expose gc extension)
  665. type: bool default: false
  666. --expose-gc-as (expose gc extension under the specified name)
  667. type: string default: nullptr
  668. --expose-externalize-string (expose externalize string extension)
  669. type: bool default: false
  670. --expose-trigger-failure (expose trigger-failure extension)
  671. type: bool default: false
  672. --stack-trace-limit (number of stack frames to capture)
  673. type: int default: 10
  674. --builtins-in-stack-traces (show built-in functions in stack traces)
  675. type: bool default: false
  676. --experimental-stack-trace-frames (enable experimental frames (API/Builtins) and stack trace layout)
  677. type: bool default: false
  678. --disallow-code-generation-from-strings (disallow eval and friends)
  679. type: bool default: false
  680. --expose-async-hooks (expose async_hooks object)
  681. type: bool default: false
  682. --expose-cputracemark-as (expose cputracemark extension under the specified name)
  683. type: string default: nullptr
  684. --allow-unsafe-function-constructor (allow invoking the function constructor without security checks)
  685. type: bool default: false
  686. --force-slow-path (always take the slow path for builtins)
  687. type: bool default: false
  688. --test-small-max-function-context-stub-size (enable testing the function context size overflow path by making the maximum size smaller)
  689. type: bool default: false
  690. --inline-new (use fast inline allocation)
  691. type: bool default: true
  692. --trace (trace javascript function calls)
  693. type: bool default: false
  694. --trace-wasm (trace wasm function calls)
  695. type: bool default: false
  696. --lazy (use lazy compilation)
  697. type: bool default: true
  698. --max-lazy (ignore eager compilation hints)
  699. type: bool default: false
  700. --trace-opt (trace lazy optimization)
  701. type: bool default: false
  702. --trace-opt-verbose (extra verbose compilation tracing)
  703. type: bool default: false
  704. --trace-opt-stats (trace lazy optimization statistics)
  705. type: bool default: false
  706. --trace-deopt (trace optimize function deoptimization)
  707. type: bool default: false
  708. --trace-file-names (include file names in trace-opt/trace-deopt output)
  709. type: bool default: false
  710. --always-opt (always try to optimize functions)
  711. type: bool default: false
  712. --always-osr (always try to OSR functions)
  713. type: bool default: false
  714. --prepare-always-opt (prepare for turning on always opt)
  715. type: bool default: false
  716. --trace-serializer (print code serializer trace)
  717. type: bool default: false
  718. --compilation-cache (enable compilation cache)
  719. type: bool default: true
  720. --cache-prototype-transitions (cache prototype transitions)
  721. type: bool default: true
  722. --parallel-compile-tasks (enable parallel compile tasks)
  723. type: bool default: false
  724. --compiler-dispatcher (enable compiler dispatcher)
  725. type: bool default: false
  726. --trace-compiler-dispatcher (trace compiler dispatcher activity)
  727. type: bool default: false
  728. --cpu-profiler-sampling-interval (CPU profiler sampling interval in microseconds)
  729. type: int default: 1000
  730. --trace-side-effect-free-debug-evaluate (print debug messages for side-effect-free debug-evaluate for testing)
  731. type: bool default: false
  732. --hard-abort (abort by crashing)
  733. type: bool default: true
  734. --expose-inspector-scripts (expose injected-script-source.js for debugging)
  735. type: bool default: false
  736. --stack-size (default size of stack region v8 is allowed to use (in kBytes))
  737. type: int default: 984
  738. --max-stack-trace-source-length (maximum length of function source code printed in a stack trace.)
  739. type: int default: 300
  740. --clear-exceptions-on-js-entry (clear pending exceptions when entering JavaScript)
  741. type: bool default: false
  742. --histogram-interval (time interval in ms for aggregating memory histograms)
  743. type: int default: 600000
  744. --heap-profiler-trace-objects (Dump heap object allocations/movements/size_updates)
  745. type: bool default: false
  746. --heap-profiler-use-embedder-graph (Use the new EmbedderGraph API to get embedder nodes)
  747. type: bool default: true
  748. --heap-snapshot-string-limit (truncate strings to this length in the heap snapshot)
  749. type: int default: 1024
  750. --sampling-heap-profiler-suppress-randomness (Use constant sample intervals to eliminate test flakiness)
  751. type: bool default: false
  752. --use-idle-notification (Use idle notification to reduce memory footprint.)
  753. type: bool default: true
  754. --trace-ic (trace inline cache state transitions for tools/ic-processor)
  755. type: bool default: false
  756. --modify-field-representation-inplace (enable in-place field representation updates)
  757. type: bool default: true 767

(本文超出站点单文档体积上限,已截断)