d****n 发帖数: 1637 | 1 没功夫学会v8-profiler, 就给我搞定了一个困扰我2周的问题。
推荐 | b***e 发帖数: 1419 | | W***o 发帖数: 6519 | 3 这话说的没头没脑,让人匪夷所思,能否说说怎么个爽法儿?
【在 d****n 的大作中提到】 : 没功夫学会v8-profiler, 就给我搞定了一个困扰我2周的问题。 : 推荐
| d****n 发帖数: 1637 | 4 cpu profiler - give you stack analysis and more important, look at its "hot
spots" zone, it most likely points to the trouble.
memory profiler - for memory leaks finding, no special than google chrome
dev tools.
transaction profiler - I like one of its core chart : average http response
time,
which helped me find a non-asynchronous function blocking IO.
and very convenient to use - click to take cpu, memory, transaction snapshot
, comparing across them.
it is not super-duper, just one tool is helpful for beginners.
【在 W***o 的大作中提到】 : 这话说的没头没脑,让人匪夷所思,能否说说怎么个爽法儿?
| b***e 发帖数: 1419 | 5 这个stack analysis有没有跨event loop,还是局限于严格意义上的runtime stack。
如果是后者的话意义不大。
hot
response
snapshot
【在 d****n 的大作中提到】 : cpu profiler - give you stack analysis and more important, look at its "hot : spots" zone, it most likely points to the trouble. : memory profiler - for memory leaks finding, no special than google chrome : dev tools. : transaction profiler - I like one of its core chart : average http response : time, : which helped me find a non-asynchronous function blocking IO. : and very convenient to use - click to take cpu, memory, transaction snapshot : , comparing across them. : it is not super-duper, just one tool is helpful for beginners.
| d****n 发帖数: 1637 | 6 Chrome profiler has similar feature, but I want to point out that usability
of nodetime.com is better(at least for me.) | d****n 发帖数: 1637 | 7 不是很明白,我是菜鸟才用这个。
大牛请给看看这个截图,是不是跨event loop。
它的cpu 百分比 call tree 似乎包括了说有的 event stack?
官方文档
V8 engine, on which Node.js is built, has a built-in sampling CPU profiler.
It records where the instruction pointer was every millisecond and creates a
call tree based on this. Although not exact, but the information is
statistically sufficient to identify which functions spent the most time in
CPU.
http://blog.nodetime.com/2012/05/cpu-profiling-with-nodetime.ht
【在 b***e 的大作中提到】 : 这个stack analysis有没有跨event loop,还是局限于严格意义上的runtime stack。 : 如果是后者的话意义不大。 : : hot : response : snapshot
| d****n 发帖数: 1637 | 8 sampling every one millisecond, 应该是cross event loop? |
|