Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cevek/slow-code-detector
https://github.com/cevek/slow-code-detector
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/cevek/slow-code-detector
- Owner: cevek
- Created: 2017-01-15T19:29:39.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-28T15:54:02.000Z (over 6 years ago)
- Last Synced: 2024-10-10T19:07:29.000Z (3 months ago)
- Language: TypeScript
- Size: 27.3 KB
- Stars: 9
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Slow-Code-Detector
Tool to show slow calls in your code runned by v8.## Install
`npm i -g slow-code-detector`## How to use
`scd your-index-js-file.js` – it creates bunch of files in current directory `code.asm` `hydrogen.cfg` `out.txt` `code.html`
`code.html` – is what you need, open it in the browser.
Also you can generate markdown file `code.md`, just run with `--md` option: `scd --md index.js`
Generated `code.html` groupped by files and functions.
## `code.html`
Every runtime call highlighted by gray. Call cost ~4ns.Pink highlight is LoadGeneric or StoreGeneric. Generic read or write cost ~9ns.
If function in code is inlined it highlighted by blue, you can show its code by click.
If function is not inlined you can show `non inline reason` by a hint on call function name.
If function deoptimized, it colored by red.
Every function reoptimization marked by ~recompile~ – max 10 times, else deopt: `Optimize too many times`
## How it works
The `scd` execute `node` with some v8 trace options and parse given logs to find slow path calls.`node --trace-inlining --trace-hydrogen --trace-phase=Z --trace-deopt`
## IRHydra
You can use `hydrogen.cfg` and `code.asm` with [IRHydra](http://mrale.ph/irhydra/2/#ir) to investigate internal representation of your code