From Electron to Swift: A Complete Rewrite of a Meeting Recording Engine

A team migrated their meeting recording engine from Electron to native Swift for lower resource usage and higher audio/video quality.
A meeting recording tool team shared their engineering journey migrating the core recording engine from Electron to native Swift. While Electron excels at cross-platform UI development, it hits architectural limits for system-level tasks like simultaneous capture of system audio, microphone, and screen. The migration to Swift enabled direct use of ScreenCaptureKit and AVFoundation, fully leveraging Apple Silicon's hardware encode/decode units to dramatically reduce CPU and memory usage. Rather than a full replacement, the team adopted a hybrid architecture — keeping Electron for the UI layer while moving the performance-sensitive recording engine into a standalone native Swift module, with the two communicating via IPC.
Why Rewrite the Recording Engine
For any desktop application that needs to capture audio and video in real time, the performance and stability of the underlying recording engine directly determines the ceiling of the user experience. Recently, a team building a meeting recording tool shared their complete journey of migrating their core recording engine from Electron to native Swift. The engineering writeup sparked broad discussion in the developer community on Hacker News.
Electron has long been a popular choice for desktop application development, thanks to its "write once, run everywhere" promise. It allows web developers to quickly ship cross-platform desktop products without needing to learn each platform's native APIs. However, when an application's core functionality involves system-level audio and video capture, Electron's architectural limitations become impossible to ignore.
The Inherent Bottlenecks of Electron
Scenarios like meeting recording place extremely high demands on low-level capabilities: simultaneously capturing system audio, microphone input, and screen content — all while keeping multiple data streams synchronized with minimal latency. Electron, being built on Chromium, often has to call system capabilities through complex bridging layers, introducing extra performance overhead and consistently high memory usage.
More critically, fine-grained control over audio/video synchronization, system permission requests, and hardware acceleration is difficult to achieve in Electron. As meeting duration increases and the number of participants grows, these problems are amplified further — ultimately manifesting as recording stutters, audio/video desync, or even crashes.

The Core Advantages of Native Swift
Rewriting the recording engine in Swift is, at its core, trading development cost for runtime performance and control. On macOS, Apple provides a mature suite of native frameworks for audio and video capture that Electron simply cannot match.
Direct Access to System-Level APIs
With Swift, the development team can directly use Apple's official frameworks such as ScreenCaptureKit and AVFoundation. Take ScreenCaptureKit, introduced in macOS 12.3 — it was specifically designed for high-performance screen recording, with support for hardware-accelerated encoding, fine-grained window filtering, and system audio capture. Its performance and stability far exceed anything achievable through browser APIs.
This "close to the metal" approach lets the engine fully leverage the hardware encode/decode capabilities of Apple Silicon chips, maintaining extremely low CPU and memory usage even when recording high-resolution content. For a meeting tool that needs to run in the background for extended periods, this improvement in resource efficiency is decisive.
ScreenCaptureKitis Apple's next-generation screen capture framework, introduced in macOS 12.3 to supersede older lower-level interfaces likeCGWindowListCreateImage. Its core advantages are threefold: first, the capture pipeline is managed directly by the system kernel, with frame data passed via shared memory — eliminating redundant memory copies; second, it natively supports fine-grained filtering by window, application, or display, so the recorder can precisely specify what enters the frame and what is excluded; third, it integrates seamlessly withAVFoundation's encoding pipeline and can leverage the Media Engine (dedicated hardware encode/decode units) on Apple Silicon to perform H.264/HEVC encoding entirely off the CPU, with minimal power consumption. By contrast, the browser'sgetDisplayMediaAPI runs inside a security sandbox, where captured frames must be relayed through Chromium's rendering process and then transferred to the business layer via IPC — a longer chain with higher latency and no direct access to system-level audio streams.
Better System Integration
Native applications offer experiences that better conform to platform conventions when it comes to permission management, system notifications, and menu bar integration. When users grant screen recording or microphone permissions, they go through the standard system flow. Application responsiveness and launch times also improve noticeably. These details together create the "native feel" that Electron applications can never fully replicate.
The Engineering Trade-offs Behind the Rewrite
Migrating from Electron to Swift is not without cost. The team was essentially solving a classic engineering trade-off problem.
Giving Up Cross-Platform Convenience
Electron's greatest value is cross-platform support. Once you commit to native Swift development, it means maintaining two separate codebases for macOS and Windows. For resource-constrained teams, this is a significant long-term investment. This explains why many teams adopt a hybrid architecture — using Electron or web technologies for the UI layer while pushing the performance-sensitive recording engine down into a native module.
This layered strategy is precisely the core idea behind this rewrite: rather than abandoning Electron entirely, the team extracted the most performance-critical recording engine, rewrote it as a standalone native component in Swift, and used inter-process communication to coordinate with the upper-level application. This approach preserves development efficiency at the UI layer while achieving native performance for core functionality.
Inter-process communication (IPC) plays a critical "glue" role in hybrid architectures. Common implementation approaches include: Unix Domain Sockets or Named Pipes for local socket communication,
NSXPCConnectionfor type-safe IPC on Apple platforms, or Electron'sMessageChannelMainto exchange JSON/binary messages with native subprocesses. For high-throughput scenarios like audio and video, it's common to separate control signaling from media data: control commands (start, pause, configure parameters) travel as lightweight JSON messages, while encoded media data is passed directly via shared memory or memory-mapped files to avoid serialization overhead becoming a new performance bottleneck. Well-designed IPC boundaries also allow the native engine module to be tested independently and to crash-recover independently, without a recording process failure bringing down the entire Electron main process.
Increased Development Complexity
Swift and Apple's audio/video frameworks have a relatively steep learning curve. Handling multi-channel audio mixing, timestamp alignment, and encoding parameter tuning all require developers with solid low-level knowledge. Compared to the rich ecosystem of ready-made libraries in the web stack, native development typically demands more in-house engineering work. But for a product where recording quality is the core competitive differentiator, that investment is worthwhile.
Takeaways for Developers
This rewrite offers several insights worth considering for desktop application developers.
There is no silver bullet in technology selection. Electron remains an excellent choice for rapid iteration and cross-platform delivery. But when a product enters the deep end where extreme performance and stability are required, the value of native technology becomes clear. Identifying the true performance bottlenecks in your application and surgically applying native optimizations is often more pragmatic than starting from scratch.
Hybrid architectures are becoming mainstream. Web for UI, native for the core — each plays to its strengths. This model balances development efficiency without sacrificing user experience on the critical path. More and more mature desktop applications are adopting this strategy.
Hardware acceleration capability defines the experience gap. For scenarios with strong hardware dependencies — audio/video processing, AI inference, and similar workloads — a native implementation close to the system is almost always necessary. As dedicated chips like Apple Silicon become more widespread, the ability to fully leverage hardware acceleration is becoming a core competitive advantage for this category of applications.
For teams building meeting recording, screen capture, or real-time collaboration products, this migration experience from Electron to Swift provides a real-world reference for how to balance performance against engineering cost.
Related articles

Vercel AI SDK Sandbox Component Receives Patch Update
Vercel AI SDK releases sandbox-vercel@1.0.109 patch update, syncing the harness dependency to the same version. A look at this maintenance release and what it means for AI app developers.

Vercel AI SDK Vue 4.0.99 Released: Dependency Update Overview
The @ai-sdk/vue 4.0.99 patch release syncs the underlying ai@7.0.99 dependency. Learn what this means for Vue developers building AI apps with Vercel AI SDK.

Vercel AI SDK Releases @ai-sdk/svelte Version Update
Vercel AI SDK releases @ai-sdk/svelte@4.0.282 patch update, syncing the core ai@6.0.282 package. Learn what this means for Svelte developers and when to upgrade.