Skip to content

监听一个机器人和监听多个机器人(比如几十个),会有显著的性能差异么 #195

Answered by ForteScarlet
chenwenhang asked this question in Q&A
Discussion options

You must be logged in to vote

理论上不会,当然前提是你的API使用方式正确且服务器性能也足够(要是1c1g用啥也救不了)。

simbot使用全异步协程实现就是为了提高整体应用性能并降低大量io造成的影响。

上文提到的使用API的方式要正确,主要就是指尽可能避免在异步API里使用阻塞API。如果是Java开发者很容易出现类似错误。
我们首先推荐使用Kotlin语言开发,这样能得到最佳体验。

当然,如果想要在使用Java和阻塞API的情况下也能得到不错的性能和开发体验,将内部的调度器换成虚拟线程调度器也是个不错的选择。Java25虚拟线程还会有进一步的优化,也是一个提高性能的好方式。

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@chenwenhang
Comment options

Answer selected by chenwenhang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants