Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(learn): Migrate the legacy guide "Easy profiling for Node.js Applications" to the learn section #6336

Merged
merged 11 commits into from
Feb 14, 2024
3 changes: 2 additions & 1 deletion i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
"nodejsTheDifferenceBetweenDevelopmentAndProduction": "Node.js, the difference between development and production",
"nodejsWithTypescript": "Node.js with TypeScript",
"nodejsWithWebassembly": "Node.js with WebAssembly",
"debugging": "Debugging Node.js"
"debugging": "Debugging Node.js",
"profiling": "Profiling Node.js Applications"
}
},
"asynchronousWork": {
Expand Down
4 changes: 4 additions & 0 deletions navigation.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@
"debugging": {
"link": "/learn/getting-started/debugging",
"label": "components.navigation.learn.gettingStarted.links.debugging"
},
"profiling": {
"link": "/learn/getting-started/profiling",
"label": "components.navigation.learn.gettingStarted.links.profiling"
}
}
},
Expand Down
36 changes: 36 additions & 0 deletions pages/en/guides/diagnostics/poor-performance/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
ovflowd marked this conversation as resolved.
Show resolved Hide resolved
title: Poor Performance - Diagnostics
layout: docs.hbs
---

# Poor Performance

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

- [Poor Performance](#poor-performance)
- [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.

This document provides two simple ways to profile a Node.js application:

- [Using V8 Sampling Profiler](/learn/getting-started/profiling/)
- [Using Linux Perf](/learn/diagnostics/poor-performance/using-linux-perf)
2 changes: 1 addition & 1 deletion pages/en/guides/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ layout: docs.hbs

## General

- [Easy profiling for Node.js Applications](/guides/simple-profiling/)
- [Diagnostics - User Journey](/guides/diagnostics/)
- [Security Best Practices](/guides/security/)

## Node.js core concepts
Expand Down
2 changes: 1 addition & 1 deletion pages/en/learn/diagnostics/poor-performance/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ the others. When we do this locally, we usually try to optimize our code.

This document provides two simple ways to profile a Node.js application:

- [Using V8 Sampling Profiler](/guides/simple-profiling/)
- [Using V8 Sampling Profiler](/learn/getting-started/profiling/)
- [Using Linux Perf](/learn/diagnostics/poor-performance/using-linux-perf)
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: Easy profiling for Node.js Applications
layout: docs.hbs
title: Profiling Node.js Applications
layout: learn.hbs
---

# Easy profiling for Node.js Applications
# Profiling Node.js Applications

There are many third party tools available for profiling Node.js applications
but, in many cases, the easiest option is to use the Node.js built-in profiler.
Expand Down
4 changes: 4 additions & 0 deletions redirects.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@
"source": "/:locale/docs/guides/timers-in-node/",
"destination": "/:locale/learn/asynchronous-work/discover-javascript-timers"
},
{
"source": "/:locale/docs/guides/simple-profiling",
"destination": "/:locale/learn/getting-started/profiling"
},
{
"source": "/:locale/docs/es6",
"destination": "/:locale/learn/getting-started/ecmascript-2015-es6-and-beyond"
Expand Down