Discord is ditching Electron and its new app uses less RAM
Discord is finally giving up on Electron, the cross-platform framework that lets developers build desktop apps using web technologies. Electron web apps are notoriously heavy on system resources, and Discord is now moving its desktop app fully to Rust — a modern programming language designed for speed and memory safety.
Discord 终于放弃了 Electron,这是一个允许开发者使用网络技术构建桌面应用程序的跨平台框架。Electron 网络应用以占用大量系统资源而闻名,Discord 现在正将其桌面应用全面迁移至 Rust——一种专为速度和内存安全而设计的现代编程语言。
“We’ve been early adopters of Rust since 2018 and a lot of our infra, voice tech, and even some of the current client is already Rust, the holy grail was getting the whole client there,” explains Discord chief technology officer Stanislav Vishnevskiy in a post on X. “That means Electron goes away, and so does React Native, mobile keeps native UI but shares app code with desktop via Rust.”
“我们从 2018 年起就是 Rust 的早期采用者,我们的许多基础设施、语音技术,甚至当前客户端的一部分都已经使用了 Rust,而终极目标是让整个客户端都实现这一点,”Discord 首席技术官 Stanislav Vishnevskiy 在 X 上的一篇帖子中解释道。“这意味着 Electron 将被淘汰,React Native 也是如此;移动端将保留原生 UI,但通过 Rust 与桌面端共享应用代码。”
Vishnevskiy also shared an image of the Discord Windows client using just 290MB of RAM, which is a clear improvement as you only have to participate in a few servers and RAM usage can easily hit 1GB or more using the current Windows app.
Vishnevskiy 还分享了一张 Discord Windows 客户端仅占用 290MB 内存的图片,这显然是一个显著的改进,因为在使用当前的 Windows 应用时,只需加入几个服务器,内存占用就很容易达到 1GB 或更多。
It’s not clear when Discord will make the full switch over to Rust, but Vishnevskiy says the company “hope to get it into testing with users soon.”
目前尚不清楚 Discord 何时会全面切换到 Rust,但 Vishnevskiy 表示,公司“希望尽快将其投入用户测试”。