Every Windows 11 app should kill Electron, and Discord just showed why
482 points
• 5 days ago
• Article
Link
Discord 正在进行重大转变,放弃 Electron 框架,转而推出全新、高度优化的 Rust 客户端。公司展示的结果表明,新版本的速度提升非常显著,彻底摆脱了长期以来基于 Electron 的应用程序常见且缓慢的"Starting"界面。在并排对比中,Rust 版本在原客户端完成初始启动之前,就已经成功加载了用户的好友列表,效率差距一目了然。
这次技术重构在内存管理方面同样带来了大幅改进。目前的 Electron 客户端在空闲状态下往往会占用 1GB 到 2GB 的 RAM,而即使同时运行两个用户账户,新的 Rust 重建版本也大约只使用 290MB 内存,内存开销减少约 70% 。 Discord 将这些成果归功于 GPUI——由 Zed 代码编辑器背后的团队开发的开源、 GPU 加速 UI 框架。通过让界面直接在 GPU 上绘制,开发团队绕开了 Electron 依赖的资源密集型浏览器引擎需求。
此次转型也不止于桌面端。 Discord 正在为移动端从 React Native 转向 Rust,用 Rust 统一代码库;同时,Web 端也将通过 WebAssembly 来承载对应的逻辑。这种架构调整确保应用在不同平台上都能保持功能丰富且运行流畅。尽管内部发生了深层变化,Discord 也确认用户界面将与现有体验保持一致,避免老用户需要重新学习如何使用该平台。
Discord 目前正在为新客户端的内部测试做准备。管理层强调,在更大范围发布之前,他们的首要任务是确保稳定性与安全性。此举也反映出科技行业的更大趋势:开发者越来越倾向于抛弃"web app slop"和臃肿的框架,改用更高效、接近原生的方案。随着由 AI 驱动硬件需求带来的成本持续上升,内存使用变得更为关键,Discord 的这一转变也为包括 WhatsApp 和 Teams 在内的其他消息平台树立了高标准——这些平台仍在很大程度上依赖资源密集型的 Web 技术。
Discord is making a significant shift away from the Electron framework in favor of a new, highly optimized Rust-based client. Demonstrations from the company show that the new version is dramatically faster, eliminating the familiar, sluggish "Starting" screen that has long characterized the Electron-based app. In a side-by-side comparison, the Rust version successfully loads a user's friends list before the original client even finishes its initial boot process, highlighting the stark difference in efficiency.
The technical overhaul brings substantial improvements to memory management as well. While the current Electron client often consumes between 1GB and 2GB of RAM during idle usage, the new Rust rebuild uses roughly 290MB, even when running two user accounts simultaneously. This represents a reduction of approximately 70% in memory overhead. Discord attributes these gains to the use of GPUI, an open-source, GPU-accelerated UI framework developed by the team behind the Zed code editor. By drawing the interface directly on the GPU, the developers have bypassed the resource-heavy browser engine requirements inherent to Electron.
The transition also extends beyond desktop applications. Discord is moving away from React Native for its mobile apps to unify its codebase using Rust, which will also power the logic for its web version via WebAssembly. This architectural change ensures that the app remains feature-rich and performant across different platforms. Despite these deep internal changes, Discord has confirmed that the user interface will remain consistent with the existing experience, ensuring that long-time users will not have to relearn how to navigate the platform.
Discord is currently preparing for private testing of the new client, with leadership emphasizing that their priority is ensuring stability and security before a wider release. The move signals a broader trend in the tech industry where developers are increasingly abandoning "web app slop" and bulky frameworks in favor of more efficient, native-like solutions. As memory usage becomes a more pressing concern due to the rising costs associated with AI-driven hardware demands, this shift by Discord sets a high bar for other messaging platforms like WhatsApp and Teams, which continue to rely on resource-intensive web technologies.
511 comments • Comments Link
• Electron 的核心价值主张仍然是:让单一团队能够借助熟悉的 Web 技术与统一的代码库,以最小的投入开发出跨平台应用。
• Electron 的出现有其时代必然性:在 2010 年代,桌面开发高度碎片化,要在跨平台场景里管理依赖、打包以及处理 Native APIs,要比今天困难得多。
• 像 Rust 这类现代替代方案,再加上改进的包管理体系与 LLM 辅助编码,降低了过去与原生开发相关的阻力;因此,Electron 的权衡——例如高内存占用和性能不佳——就越来越难以自圆其说。
• Electron 自带了一整套强大的无障碍能力(accessibility features)。这些能力在自定义的 Native UI framework 中往往难以复现,这为残障用户提供了许多替代工具包尚未匹配的关键优势。
• Discord 从 Electron 转向基于 Rust 的自定义架构,体现了向原生性能靠拢的取向。尽管如此,与成熟的 Web 生态相比,这种自研框架在长期可维护性和功能等价性方面仍有待验证。
• 关于 Electron 的争论,通常反映的是"快速上线"的商业优先级(更看重跨平台覆盖与降低工程成本)与更重视系统资源效率和原生行为的用户与开发者之间的冲突。
• 原生框架的拥护者认为 Electron 助长了开发者的偷懒以及软件的"臃肿"。而支持者则坚称 Electron 让小团队得以打造功能丰富的产品,否则在多个操作系统环境下分别开发这些产品在成本上根本不可接受。
• 现代桌面应用的性能问题常常被归咎于对 Web 技术的滥用。也有人认为,就算是原生应用也同样普遍缺乏优化;在这种叙事中,Electron 只是行业软件"越来越臃肿"这股大趋势下被推出来的便利替罪羊。
• 新一代跨平台 UI framework 的兴起(如 GPUI 以及各种基于 Rust 的方案)表明行业正开始走向一个"中间地带":既吸收 Web 开发中对开发者友好的模式,又能兼顾原生代码的性能与效率。
• 虽然 AI 和 LLM 目前被宣传为解决维护多个 codebases"复杂性"的办法,但也有人担心,这些工具最终只会推动"臃肿"软件的持续生产,而不是从根本上解决底层架构层面的矛盾。
这场讨论反映出人们对现代桌面应用资源消耗的深层挫败感,许多人将这种问题归因于 Electron 的普及。尽管参与者普遍认可,Electron 在生态系统高度碎片化的阶段通过简化跨平台开发发挥了关键作用,但业界也有强烈共识:我们正在进入一个新的时代——原生性能与高效内存使用再次成为竞争优势。新工具的出现说明,开发者正在主动寻找一种架构:既能保留 Web 的快速迭代节奏,又不必为捆绑完整浏览器引擎所带来的沉重开销买单。归根结底,这场对话揭示了企业在所有平台上同步交付功能的即时、务实需求,与用户对高性能、具有原生体验的软件之间的拉扯关系。 • Electron's primary value proposition remains its ability to allow a single team to produce cross-platform applications with minimal effort by leveraging familiar web technologies and a unified codebase.
• The historical necessity of Electron stemmed from the fragmented state of desktop development in the 2010s, where managing cross-platform dependencies, packaging, and native APIs was significantly more difficult than it is today.
• Modern alternatives like Rust, coupled with improved package management systems and LLM-assisted coding, have reduced the friction previously associated with native development, making the trade-offs of Electron—such as high memory consumption and poor performance—increasingly difficult to justify.
• Electron provides robust out-of-the-box accessibility features that are often difficult to replicate in custom native UI frameworks, providing a critical benefit for users with disabilities that many alternative toolkits have yet to match.
• Discord's transition from Electron to a custom Rust-based architecture demonstrates a move toward native performance, though the long-term maintainability and feature parity of such custom frameworks compared to the mature web ecosystem remain to be proven.
• The debate over Electron often reflects a clash between "ship-it-fast" business priorities, which favor cross-platform reach and reduced engineering overhead, and a segment of users and developers who prioritize system resource efficiency and native behavior.
• Proponents of native frameworks argue that Electron encourages developer laziness and "bloated" software, while supporters maintain that Electron enables small teams to build feature-rich products that would otherwise be cost-prohibitive to develop for multiple OS environments.
• Performance concerns in modern desktop apps are frequently attributed to the misuse of web technologies, though some argue that even native apps are often unoptimized and that Electron is merely a convenient scapegoat for broader industry trends toward software bloat.
• The rise of new cross-platform UI frameworks, such as GPUI and various Rust-based options, suggests the industry is beginning to move toward a "middle ground" that seeks to combine the developer-friendly patterns of web development with the performance and efficiency of native code.
• While AI and LLMs are currently touted as a solution to the "complexity" of maintaining multiple codebases, some argue that these tools ultimately facilitate the continued creation of "bloated" software rather than fundamentally solving the underlying architectural issues.
The discussion reflects a deep-seated frustration with the resource consumption of modern desktop applications, which many blame on the ubiquity of the Electron framework. While participants acknowledge that Electron served a vital function by simplifying cross-platform development during a period of high ecosystem fragmentation, there is a strong consensus that the industry is entering a new era where native performance and efficient memory usage are becoming competitive advantages once again. The emergence of new tools suggests that developers are actively seeking architectures that provide the rapid iteration cycles of the web without the heavy overhead of bundling a full browser engine. Ultimately, the conversation highlights a tension between the immediate, pragmatic needs of businesses to ship features across all platforms simultaneously and the desire of users for performant, native-feeling software.