node.js 应用程序中的 epoll_pwait 是什么,我该怎么办?

Esq*_*uth 13 profiling epoll node.js

我的应用程序是棋盘游戏Settlers of Catan的网络版本。

我正在使用node --prof app.js来分析应用程序并将node --prof-process ISOLATE_LOG_FILE > processed.txt它们转换为处理过的文件。

我确实收到了很多Code move event for unknown code事件:https : //prnt.sc/q69ugk

最后我留下了一个文件,如下所示:

Statistical profiling result from isolate-0x3df60c0-v8.log, (13113 ticks, 192 unaccounted, 0 excluded).

在此处输入图片说明

  1. node.js上下文中的这个epoll_pwait是什么?
  2. 为什么它使用了我应用程序的 60%?
  3. 我该怎么办?

maj*_*d5_ 1

epoll_pwait本质上意味着你的应用程序(事件循环)正在等待某些东西,即 I/O 操作。

\n

引用上面的链接:

\n

调用epoll_pwait()将阻塞,直到:

\n
   \xe2\x80\xa2 a file descriptor delivers an event;\n\n   \xe2\x80\xa2 the call is interrupted by a signal handler; or\n\n   \xe2\x80\xa2 the timeout expires.\n
Run Code Online (Sandbox Code Playgroud)\n
\n

为了进一步调试,我真正想到的是,如果您有任何setInterval超时很少或为零的代码,如果是这样,请发布您要传递给间隔的回调函数。

\n