Skip to content

Commit

Permalink
doc: profiling - add README
Browse files Browse the repository at this point in the history
PR-URL: #339
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <Michael_Dawson@ca.ibm.com>
  • Loading branch information
Peter Marton authored and gireeshpunathil committed Nov 22, 2019
1 parent ca05202 commit 644ed33
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 1 deletion.
30 changes: 30 additions & 0 deletions documentation/profiling/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Profiling

In this document you can learn about how to profile a Node.js process.

- [Profiling](#profiling)
- [My application has a poor performance](#my-application-has-a-poor-performance)
- [Symptoms](#symptoms)
- [Debugging](#debugging)

## My application has a poor performance

### Symptoms

My applications latency is high and I have already confirmed that the bottleneck
is not my dependencies like databases and downstream services. So I suspect that
my application spends significant time to run code or process information.

You are satisfied with your application performance in general but would like to
understand which part of our application can be improved to run faster or more
efficient. It can be useful when we want to improve the user experience or save
computation cost.

### Debugging

In this use-case, we are interested in code pieces that use more CPU cycles than
the others. When we do this locally, we usually try to optimize our code.

- [Using V8 Profiler](./step1/using_v8_profiler.md)
- [Using Linux Perf](./step2/using_linux_perf.md.md)
- [Using Native Tools](./step3/using_native_tools.md)
8 changes: 8 additions & 0 deletions documentation/profiling/step1/using_v8_profiler.md
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
# Using V8 Sampling Profiler (--prof)

V8 Profile​ (--prof) is the V8’s built-in sampling based profiler to track CPU
Usage. ​0x​ is an npm library that makes capturing and visualizing flamegraphs
via --prof easier.

## How To

//TODO
13 changes: 13 additions & 0 deletions documentation/profiling/step2/using_linux_perf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Using Linux Perf

Linux Perf provides low level CPU profiling with JavaScript, native and OS level frames.

## How To

// TODO

## Useful Links

- https://nodejs.org/en/docs/guides/diagnostics-flamegraph/
- [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)
- https://github.com/mmarchini/node-linux-perf
1 change: 0 additions & 1 deletion documentation/profiling/step2/using_linux_profiler.md

This file was deleted.

8 changes: 8 additions & 0 deletions documentation/profiling/step3/using_native_tools.md
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
# Native Tools

System profilers (such as Linux perf, eBPF, DTrace, etc.) can sample the stack
trace of applications and generate reports or graphs to help understand the code
path our application is taking.

## How To

//TODO

0 comments on commit 644ed33

Please sign in to comment.