- electron.ipcRenderer.send
- electron.ipcRenderer.sendTo
- electron.MessageChannelMain
- BroadcastChannel
single channel
tow channel
建立两个 Channel,分别用于接收和发送
- Node.js child_process.fork
- Node.js worker_threads 工作线程
- 不能在渲染进程中使用: ERR_MISSING_PLATFORM_FOR_WORKER
平均性能排名:
worker_threads
性能最好,但只能在主进程中使用。密集通信可能会导致主进程阻塞,进而阻塞渲染进程- 达到阻塞的阈值条件较高,绝大部分场景下都可适用
ipc.send
性能也较好,但主要是与主进程通信,密集通信同样可能造成进程阻塞child_process.fork
MessageChannelMain
ipc.sendTo
BroadcastChannel
BroadcastChannel-TowChannel