Skip to content

Commit 644ed33

Browse files
Peter Martongireeshpunathil
authored andcommitted
doc: profiling - add README
PR-URL: #339 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent ca05202 commit 644ed33

File tree

5 files changed

+59
-1
lines changed

5 files changed

+59
-1
lines changed

documentation/profiling/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Profiling
2+
3+
In this document you can learn about how to profile a Node.js process.
4+
5+
- [Profiling](#profiling)
6+
- [My application has a poor performance](#my-application-has-a-poor-performance)
7+
- [Symptoms](#symptoms)
8+
- [Debugging](#debugging)
9+
10+
## My application has a poor performance
11+
12+
### Symptoms
13+
14+
My applications latency is high and I have already confirmed that the bottleneck
15+
is not my dependencies like databases and downstream services. So I suspect that
16+
my application spends significant time to run code or process information.
17+
18+
You are satisfied with your application performance in general but would like to
19+
understand which part of our application can be improved to run faster or more
20+
efficient. It can be useful when we want to improve the user experience or save
21+
computation cost.
22+
23+
### Debugging
24+
25+
In this use-case, we are interested in code pieces that use more CPU cycles than
26+
the others. When we do this locally, we usually try to optimize our code.
27+
28+
- [Using V8 Profiler](./step1/using_v8_profiler.md)
29+
- [Using Linux Perf](./step2/using_linux_perf.md.md)
30+
- [Using Native Tools](./step3/using_native_tools.md)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1+
# Using V8 Sampling Profiler (--prof)
2+
3+
V8 Profile​ (--prof) is the V8’s built-in sampling based profiler to track CPU
4+
Usage. ​0x​ is an npm library that makes capturing and visualizing flamegraphs
5+
via --prof easier.
6+
7+
## How To
8+
19
//TODO
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Using Linux Perf
2+
3+
Linux Perf provides low level CPU profiling with JavaScript, native and OS level frames.
4+
5+
## How To
6+
7+
// TODO
8+
9+
## Useful Links
10+
11+
- https://nodejs.org/en/docs/guides/diagnostics-flamegraph/
12+
- [http://www.brendangregg.com/blog/2014-09-17/node-flame-graphs-on-linux.html](http://www.brendangregg.com/blog/2014-09-17/node-flame-graphs-on-linux.html)
13+
- https://github.com/mmarchini/node-linux-perf

documentation/profiling/step2/using_linux_profiler.md

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1+
# Native Tools
2+
3+
System profilers (such as Linux perf, eBPF, DTrace, etc.) can sample the stack
4+
trace of applications and generate reports or graphs to help understand the code
5+
path our application is taking.
6+
7+
## How To
8+
19
//TODO

0 commit comments

Comments
 (0)