简体   繁体   English

您将如何将 node.js 子进程与 discord.js 一起使用?

[英]How would you use node.js child processes with discord.js?

So I have a discord bot coded in javascript that is extremely slow when interacting with the database or doing image manipulation.所以我有一个编码为 javascript 的 discord 机器人,它在与数据库交互或进行图像处理时速度非常慢。 Is there a way to integrate it with node child processes to use more than one core and speed up the process?有没有办法将它与节点子进程集成以使用多个核心并加快进程? Currently, it takes around 30 seconds for image manipulation to complete after a command is run.目前,运行命令后完成图像处理大约需要 30 秒。 Can someone please explain how would I go with implementing node child processes with canvas.js to speed up discord.js bot?有人可以解释一下我 go 如何使用 canvas.js 实现节点子进程来加速 discord.js 机器人吗? Thank you谢谢

You can take a look at https://www.npmjs.com/package/node-worker-threads-pool but if it's only the image manipulation that is slow it will not speed it up.您可以查看https://www.npmjs.com/package/node-worker-threads-pool但如果只是图像处理速度慢,则不会加快速度。 What are you using?你在用什么? Sharp?锋利的? What manipulation are you doing?你在做什么操纵?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM