Skip to main content

We need a rewrite

ยท 2 min read
Jeve Stobs

Why we decided to rewrite Acoustic for the third time. And how we plan to make Acoustic even faster in the future โžœ

Rewriting Acoustic for the third time was not a decision made lightly. The dev team was already exhausted ๐Ÿ˜ฉ from adding the finishing touches to Acoustic's Music, & then management sprung this on them!

However, monitoring had shown that there had been a massive performance degradation as we joined more and more servers.

Performance Issuesโ€‹

Ping would spike, interactions would fail more frequently, and lag was extremely noticeable when queueing songs. If there were over 20 people using Acoustic (thank you), it could take upwards of 2 minutes for it to join the channel. Thankfully, music didn't lag once it started, but this was still unacceptable performance.

Discord.js doesn't scale too well and memory leaks are a notable issue. There is a detailed GitHub post about memory usage using various javascript libraries to interact with Discord's API that heavily influenced our decision.

We were able to minimize some of this interaction latency by reducing the number of gateway intents that we received but this was just a band-aid solution. So we decided to move over to Rust.

Rust is a high-level language designed for performance and it works really well with Discord. It has almost 100% coverage of the Discord API so we can release features just as fast as we were able to do on Discord.js. It also integrates well as a backend for our dashboard that's coming soon so stay tuned.

Moving forwardโ€‹

This rewrite is the largest yet and it opens up an entirely new world for what is possible. Server hosting will be cheaper as Rust is more efficient than JavaScript & it will allow us to operate much faster and at a higher level of quality than before.

We're really excited to show you all of the cool new things we have planned for this rewrite and the many releases to come. Thanks for sticking with us!

TL;DRโ€‹

Acoustic is being rewritten in Rust for performance and stability.