跳到内容

性能不佳

【Poor Performance】

在本文档中,你可以了解如何分析 Node.js 进程。

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

我的应用性能很差

【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】

在这个使用场景中,我们关注的是那些比其他代码片段使用更多 CPU 周期的代码。当我们在本地进行这一操作时,通常会尝试优化我们的代码。

【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.】

本文档提供了两种简单方法来分析 Node.js 应用:

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