Tauri vs Electron for an MCP Client: Memory, Start-up and Where IPC Lies, Measured
Many of the desktop tools a developer keeps open all day are Electron apps: VS Code, Cursor, Postman. Tauri is the answer people usually give to that: a Rust backend and the system's own webview instead of a bundled Chromium. I am building an API client on Tauri, Milo, and the question I keep running into is not "which framework is lighter", but where the memory and the milliseconds actually go once real data starts moving: a 50 MiB query result, or the result of an MCP tool call that an AI agent asked for.
So I built the same small app twice, once on Tauri 2.12 and once on Electron 45: the same HTML page, the same MCP server, the same three payloads of database-like rows (1, 10 and 50 MiB). Then I measured what a user and a developer would notice: memory of every process the app owns, time to the first frame, and the time and peak memory of getting the rows from the backend into the page by every route each framework offers.
Five results are worth knowing before you pick a framework or an IPC route for a data-heavy tool.
- Tauri used 26.5 MiB less at idle, and the MCP client cost it nothing. An empty window took 59.5 MiB on Tauri and 86.0 MiB on Electron, counting every process. Connecting an MCP client added 16.7 MiB to Electron, where the TypeScript SDK loads into the main process, and nothing measurable to Tauri. The MCP server itself, a Node process, took about 35 MiB: more than Tauri's own app process.
- Tauri did not start faster. The page's script ran after 309 ms on Tauri and 321 ms on Electron (median of 30 launches). The first frame came at 377 and 326 ms. In 4 of 50 Tauri launches WebKit held the first frame back for 8 to 80 seconds after the script had run, because the window started out hidden; Electron draws a hidden window anyway.
- The fastest IPC routes are close; the rule behind them is "serialise once". 50 MiB of JSON text reached the page as a parsed array in 112 ms through Tauri's
ipc::Responseand in 108 ms as an Electron string; in a second run on fresh builds, 115 and 142 ms. Most of that isJSON.parsein the page. Parsing it in the backend and returning objects took 279 ms on Tauri and 652 ms on Electron. But when the backend already holds the rows as structs, Tauri's default return was the faster one, and Electron's object route stayed four times slower than a string. - IPC lies in three places I tripped over. In Tauri,
Vec<u8>and&[u8]are sent as JSON arrays of numbers, from a command and from aChannelalike, the way Tauri's ownChannelexample streams a file: 1,080 ms and a 2.4 GiB page process for 50 MiB. A TauriChannelresolvesinvoke()before the first chunk arrives. And half of Electron's object cost is the copycontextBridgemakes, not IPC. - The MCP client was the biggest cost of all. A 50 MiB tool result took 4.7 s to reach the Electron page, because the TypeScript SDK's stdio reader copies and rescans the whole message on every chunk. With its default limit, a message over 10 MiB closes the session and stops the server, and with JSON rows that already happened at 9 MiB of tool text. Rust's rmcp read the same result in 0.26 s, but drops a message over 16 MiB without answering the call.
Everything is in the companion repository: both apps, the MCP server, the payload generator, the harness that launched every run, and the run files every number comes from. python3 bench/report.py recomputes the numbers, and bench/check_article.py checks that this article quotes them as computed. Every code snippet below is copied from a file in that repository.
The setup
The two apps share one page, ui/index.html, and one benchmark script. Each app gives the page a window.bridge object with the same methods, so the page code that times a transfer is identical. The Tauri bridge is built from window.__TAURI__; the Electron one comes from a preload script through contextBridge, with context isolation and the sandbox on, as Electron's security checklist asks (both are Electron's defaults).
The data is a JSON array of order rows, written once by bench/make-payloads.mjs with a fixed seed, so both backends read byte-identical files: 1 MiB (4,055 rows), 10 MiB (40,376 rows) and 50 MiB (201,331 rows). Every transfer ends the same way: the page holds a parsed array and adds up the amount of every row, so nothing stays lazy, and the checksum is compared across all runs.
The MCP server, mcp-server/server.mjs, is a stdio server on the official TypeScript SDK with one tool, query_rows, that returns one of those files as text. The Electron app connects to it with the same SDK from the main process; the Tauri app with rmcp, the official Rust SDK, from the Rust process.
| Tauri app | Electron app | |
|---|---|---|
| Framework | Tauri 2.12.5, @tauri-apps/cli 2.12.4 | Electron 45.2.3 (Chromium 156, Node 24.22) |
| Page engine | the system WebKit (macOS 27.2) | its own Chromium |
| MCP client | rmcp 3.9.0 | @modelcontextprotocol/sdk 1.32.2 |
| Build | tauri build, release profile with LTO | @electron/packager 20.3.0, asar |
| App bundle on disk | 7.3 MiB | 268.7 MiB |
Everything ran on one MacBook Pro with an M1 Pro and 32 GB of memory, on macOS 27.2. The harness, bench/run.py, starts the packaged app binary directly, with the scenario in environment variables, reads the page's marks from the app's standard output, reads the memory of every process and then quits the app.
How memory is counted
Memory is the footprint: the number Activity Monitor shows in its Memory column, which counts a process's own dirty and compressed memory and not the shared framework pages that resident size (RSS) counts again in every process. The harness reads it for each process with proc_pid_rusage, which also gives the process's lifetime peak, so the peak of a transfer needs no sampling. I checked the call against Apple's footprint tool on the same process: the same number, to the byte.
The hard part was deciding which processes belong to the app. Electron's renderer, GPU and network processes are children of the main process. Tauri's are not: WebKit's page, GPU and networking services are started by launchd. My first harness counted every WebKit process that appeared after the launch, and that picked up Mail's WebKit processes now and then, which turned a 60 MiB Tauri app into a 368 MiB one. The second used macOS's responsible-process record, which is how Activity Monitor groups processes, and lost all three WebKit processes: an app started from a terminal is not responsible for itself; the terminal is. The final rule takes WebKit processes that are new since the launch and share the app's responsible process. The runs made with the earlier versions are kept in runs/discarded/; every number here comes from the final harness.

Vocabulary
| Term | What it means here |
|---|---|
| IPC | Inter-process communication: how data gets from the backend (Tauri's Rust process, Electron's main process) to the page, which runs in another process. |
| serde | Rust's serialisation framework. A Tauri command's return value goes through serde::Serialize into JSON unless the command returns tauri::ipc::Response. |
ipc::Response | Tauri's way to return raw bytes; the page gets an ArrayBuffer. |
Channel | Tauri's stream from a command to the page: the command sends messages, the page's onmessage receives them. |
| Custom protocol | A URL scheme the backend answers (bench:// here), which the page reads with fetch like an HTTP response. Tauri: register_asynchronous_uri_scheme_protocol; Electron: protocol.handle. |
| Structured clone | The algorithm Electron's ipcRenderer.invoke uses to copy arguments and results between processes. |
contextBridge | Electron's way to expose an API from the isolated preload world to the page's world. Values that cross it are copied. |
| MCP, stdio transport | The Model Context Protocol. With stdio, the client starts the server as a child process and they exchange JSON-RPC messages, one per line. |
| Footprint | A process's own memory as macOS accounts it, what Activity Monitor shows. Peak footprint is its highest value over the process's life. |
Memory at idle
Each app was launched 10 times with an empty page and 10 times with an MCP client connected, alternating between the two apps, and measured 5 seconds after its first frame.

| Process | Tauri | Electron |
|---|---|---|
| App / main process | 26.4 MiB | 42.9 MiB |
| App / main process with the MCP client | 25.8 MiB | 59.4 MiB |
| Page (WebKit WebContent / Chromium renderer) | 15.2 MiB | 19.6 MiB |
| GPU | 11.9 MiB | 16.8 MiB |
| Network | 6.1 MiB | 6.7 MiB |
| All of the app's processes | 59.5 MiB | 86.0 MiB |
| With the MCP client | 58.8 MiB | 102.7 MiB |
Medians per process; the totals are medians of each launch's total, so the rows do not add up to them exactly. Electron's 10 empty launches ranged from 85.3 to 87.3 MiB, Tauri's from 57.9 to 66.8 MiB.
Two things stand out. First, the difference is real, but it is not an order of magnitude. A Tauri window still runs the system WebKit's page process, GPU process and network process, and they are charged to the app. On a 32 GB machine 26.5 MiB is not the reason to change frameworks; the 261 MiB of disk might be.
Second, an MCP client is where the frameworks part. rmcp is compiled into the Rust binary that is already running, and the Tauri app process stayed at 26 MiB with it connected. The TypeScript SDK is JavaScript loaded into Electron's main process: 16.5 MiB more there. And the server costs more than either: a Node MCP server took 35 MiB, more than the whole Tauri app process. A tool that starts three or four Node stdio servers like this one spends more on them than on the UI framework, whichever one it is.
Start-up: a tie, and a stall
Start-up was measured separately, 30 launches of each app with an empty page, alternating. The page sends two marks: when its script runs, and after its first animation frame. The harness timestamps both from the moment it starts the process.
| Tauri | Electron | |
|---|---|---|
| Page script runs (median) | 309 ms | 321 ms |
| First frame (median) | 377 ms | 326 ms |
| First frame after the script (median) | 69 ms | 7 ms |
| First frame later than 1 s | 4 of 50 launches: 7.9 s, 29.1 s, 48.7 s, 80.2 s | 0 of 50 |
The 50 launches are the 30 above and the 20 empty and MCP launches of the memory test. With an MCP client connected before the window opens, the median first frame in the memory test was 710 ms on Tauri and 647 ms on Electron, against 378 and 360 ms without it: starting the Node server added about 0.3 s to both.
So on this Mac, Tauri does not start faster. Both apps spend about 0.3 s before the page runs any code. Electron's first frame then follows within a few milliseconds; WebKit's comes 69 ms after the script. The stalls are the surprise. In the 29.1 s launch, the page's own clock says the script ran at 10 ms and the frame came at 28,756 ms, with document.visibilityState reporting visible. The app was running; WebKit was not drawing.
A later test found the mechanism. I started each app five times with its window shown and five times with it hidden (BENCH_HIDDEN=1), and recorded visibilityState when the script ran. With the window hidden, WebKit drew no frame within 20 seconds in 5 of 5 launches, and the page said hidden from its first line. Electron drew its first frame in 5 of 5 hidden launches and said visible: its documentation says a window created with show: false paints anyway and starts as visible (paintWhenInitiallyHidden, on by default). And one of the five "shown" Tauri launches started hidden as well and never drew. On macOS the visibility state also follows occlusion, so a window that opens behind others or on another Space counts as hidden. That evening, with my own windows over the screen, the stalls became the rule: 3 of 4 Tauri launches in a run started hidden and drew nothing. Why a window that is told to show starts hidden, I have not pinned down. What I take from it: if your app waits for requestAnimationFrame before it calls itself ready, or before it starts work, on WebKit that wait can be long.
50 MiB through IPC
For each route, the harness launched the app once per payload size, the page made one warm-up call and five timed calls, and the harness read the peak memory of every process before quitting. The time runs from the call in the page to the parsed array in the page.
![Horizontal bar chart: 50 MiB of rows from the backend to a parsed array in the page, the backend starting from JSON text, median of 5 calls. Electron first 100 rows 102 ms, Electron string 108 ms, Tauri ipc::Response 112 ms, Tauri custom protocol 112 ms, Tauri first 100 rows 125 ms, Electron Buffer 128 ms, Electron protocol.handle 178 ms, Tauri parse, Vec<Row> 279 ms, Tauri String 284 ms, Electron parse, object 652 ms, Tauri Channel of &[u8] 948 ms, Tauri Vec<u8> 1,080 ms.](https://wolinski.com/blog/tauri-vs-electron-ipc-memory-chart-2.png)
| App | How the rows travel | 1 MiB | 10 MiB | 50 MiB | Page peak at 50 MiB |
|---|---|---|---|---|---|
| Tauri | parse in Rust, return Vec<Row> through serde | 9 ms | 69 ms | 279 ms | 309 MiB |
| Tauri | String, parsed in the page | 10 ms | 71 ms | 284 ms | 461 MiB |
| Tauri | Vec<u8> without Response | 30 ms | 216 ms | 1,080 ms | 2,450 MiB |
| Tauri | ipc::Response (an ArrayBuffer) | 6 ms | 30 ms | 112 ms | 914 MiB |
| Tauri | Channel of 1 MiB &[u8] chunks | 36 ms | 213 ms | 948 ms | 647 MiB |
| Tauri | custom protocol, read with fetch | 10 ms | 39 ms | 112 ms | 761 MiB |
| Tauri | parse in Rust, send the first 100 rows | 9 ms | 41 ms | 125 ms | 23 MiB |
| Electron | parse in main, return the object through invoke | 16 ms | 127 ms | 652 ms | 617 MiB |
| Electron | string, parsed in the page | 4.8 ms | 33 ms | 108 ms | 600 MiB |
| Electron | Buffer (a Uint8Array) | 7 ms | 45 ms | 128 ms | 709 MiB |
| Electron | protocol.handle, read with fetch | 7.2 ms | 174 ms | 178 ms | 452 MiB |
| Electron | parse in main, send the first 100 rows | 7.6 ms | 20 ms | 102 ms | 22 MiB |
WebKit's performance.now() has a 1 ms resolution here, so the Tauri times are whole milliseconds. Electron's protocol.handle at 10 MiB is the one noisy cell: its five calls ranged from 138 to 445 ms, and I have no explanation for it.
The fast routes are fast for the same reason: the bytes arrive as bytes. Tauri's ipc::Response took 23 ms to deliver 50 MiB to the page, and Electron's string 32 ms. Then JSON.parse took 89 ms in WebKit and 74 ms in V8. On every fast route, parsing in the page was most of the time. This is the part a faster IPC cannot remove: the page needs objects, and JSON text becomes objects only by parsing it.
Returning raw bytes in Tauri is one line, from tauri-app/src/lib.rs:
#[tauri::command]
fn rows_raw(bench: State<'_, Bench>) -> Response {
Response::new(bench.payload.to_vec())
}Parsing in the backend and returning objects is slower in both frameworks, for different reasons. Tauri's typed Vec<Row> is parsed by serde in Rust, serialised back to JSON by serde, and parsed again by the webview: 279 ms. Returning the JSON text as a Rust String was no better, 284 ms, because a String is serialised as a JSON string: every quote in the rows gets escaped on the way and unescaped in the page. Electron's object route is taken apart under Where IPC lies.
When the backend already holds the rows
Every route above starts from JSON text in the backend, which is what an HTTP response or an MCP tool result gives you. A backend that reads rows from a database starts from objects instead, and has to serialise them either way. So I ran four more routes in which the backend parses the 50 MiB once at start-up and holds the rows: Tauri returns them as Arc<Vec<Row>> (serde writes the JSON) or serialises them itself with serde_json::to_vec into an ipc::Response; Electron returns the object or JSON.stringify of it.
| Backend holds 201,331 rows, 50 MiB as JSON | Median | Calls | Page peak |
|---|---|---|---|
| Tauri, return the structs (serde writes the JSON) | 165 ms | 163 to 198 ms | 387 MiB |
Tauri, serde_json::to_vec into ipc::Response | 190 ms | 166 to 201 ms | 866 MiB |
| Electron, return the object | 567 ms | 534 to 590 ms | 615 MiB |
Electron, return JSON.stringify of it | 144 ms | 128 to 174 ms | 598 MiB |
In Tauri, serialising the structs yourself to bytes bought nothing: the default return was a little faster and the page peaked at less than half the memory. Bytes win in Tauri when the backend holds text, because the alternatives then make serde either parse it into structs or escape it as one JSON string. In Electron the advice holds from both starting points: stringify in the main process and parse in the page. The rule that covers all of it is to serialise once.
Peak memory is the bigger number
The last column of the table is the one I did not expect to matter most. On every route that ships the whole array, 50 MiB of JSON text took the page process to a peak of 309 to 914 MiB, and to 2,450 MiB for Vec<u8>. The text, its decoded copy, the parsed objects and the garbage the parser leaves behind are all alive at some point. The lowest of those, 309 MiB, is Tauri's serde route; I did not measure why it stays lower than the routes that hand the page JSON text to parse. The two routes that send only the first 100 rows, after the backend parses everything, kept the page at 22 and 23 MiB and took 102 and 125 ms, about as long as the fastest full transfers: the backend's parse costs about what the page's would.
One expectation did not hold for this workload: Rust did not parse JSON faster than JavaScript. serde parsed the 50 MiB into typed rows and sent 100 of them in 125 ms, and in 109 ms in the second run; V8 in Electron's main process did the same in 102 and 106 ms.
Where IPC lies
Three routes did something different from what their code suggests.
Tauri: Vec<u8> is not bytes
A command that returns Vec<u8> looks like it returns bytes. It returns a JSON array of numbers, because Vec<u8> implements Serialize and only ipc::Response takes the raw path. Every byte becomes one to three digits and a comma, and the page builds an array of 52 million numbers before it can turn them back into bytes. At 50 MiB that took 1,080 ms, the page process peaked at 2,450 MiB, and all of the app's processes together at 3,479 MiB. Tauri's documentation says that return values are serialised to JSON and points to ipc::Response for large data; nothing warns at the call site.
Tauri: a Channel resolves before its data
My first Channel version awaited invoke() and then parsed what the channel had received. It threw. The page now records how many chunks it had when invoke() resolved: 0 in each of the 9 calls at 1, 10 and 50 MiB, out of 2, 11 and 51. The command's return and the channel's messages travel separately, and the return comes first.

The fix is to make completion part of the data: the command returns the number of bytes it sent, and the page waits until it has received that many. From tauri-app/src/lib.rs:
// Returns the byte count: the page cannot treat the resolved invoke() as "all chunks arrived".
#[tauri::command]
fn rows_channel(bench: State<'_, Bench>, on_chunk: Channel<&[u8]>) -> Result<usize, String> {
let chunk_kib: usize = var("BENCH_CHUNK_KIB", "1024")
.parse()
.map_err(|_| "BENCH_CHUNK_KIB is a number")?;
for chunk in bench.payload.chunks(chunk_kib * 1024) {
on_chunk.send(chunk).map_err(|e| e.to_string())?;
}
Ok(bench.payload.len())
}Tauri's own Channel example ends its stream with a Finished event in the data, which is the same idea; the documentation does not say that invoke() may resolve first. And with that fixed, the channel was the second-slowest route: 948 ms for 50 MiB, against 112 ms for one ipc::Response. The chunk size was not the reason: with 64 KiB, 1 MiB and 8 MiB chunks the same transfer took 944, 936 and 945 ms.
The reason is the first lie again. A Channel sends anything that implements Serialize as JSON, and &[u8] does, so each 1 MiB chunk arrived in the page as an Array of numbers, not an ArrayBuffer. Tauri's documentation streams file chunks exactly this way, through a Channel<&[u8]>. Wrapping each chunk in ipc::Response, so the channel is a Channel<Response>, made the chunks arrive as ArrayBuffers, and 50 MiB took 115 ms instead of 938 in the same run: as fast as one response. So a channel is not slow; a channel of byte slices is.
Electron: an object is copied twice
Returning an object from ipcMain.handle is the most natural Electron code there is, and it was the slowest Electron route: 652 ms for 50 MiB, six times the string route. To see where the time goes, I ran the same three routes with context isolation and the sandbox turned off (BENCH_NO_ISOLATION=1, never for a real app), so the preload hands values to the page directly instead of through contextBridge.
| Electron, 50 MiB | Context isolation on (default) | Off |
|---|---|---|
Object through invoke | 652 ms | 301 ms |
| String, parsed in the page | 108 ms | 117 ms |
Buffer, decoded and parsed in the page | 128 ms | 128 ms |
For an object, contextBridge's copy into the page's world was more than half of the time. The remaining 301 ms are the main process parsing the JSON and structured clone rebuilding 201,331 objects in the renderer. The parse is the smaller part: the first-100-rows route, which parses the same 50 MiB in the main process and sends almost nothing, took 102 ms in total. Even without the bridge, an object was almost three times slower than sending a string and parsing it in the page. A string or a byte buffer crosses both boundaries almost for free. The rule I took away: never return a large object through Electron IPC; return its JSON text and parse it where you need it.
What about shared memory?
I found no API in either framework's documentation for sharing memory between the backend and the page, and every route above copies. But the numbers say shared memory would not have helped much here. The byte transfer on the fast routes took 23 to 38 ms of the 108 to 128; the rest was turning JSON into objects. What helped was not sending the 50 MiB at all.
The MCP client was the real bottleneck
An MCP tool result travels further than the IPC routes above. The server writes it as one JSON-RPC line on its standard output, the client reads that line, and only then does the backend have something to send to the page. Over stdio, the tool's text is a JSON string inside a JSON message, so every quote is escaped: the 50 MiB result was a 56.1 MiB line.

Inside the apps, a 50 MiB tool result reached the page in 383 ms on Tauri (rmcp, then ipc::Response) and in 4,662 ms on Electron (the TypeScript SDK, then a string). To separate the client from the app, I ran both clients alone, without a window, against the same server: four calls in a row, 1, 10, 50 and again 1 MiB.
| Client alone | 1 MiB | 10 MiB | 50 MiB | Then 1 MiB again |
|---|---|---|---|---|
| TypeScript SDK, default limit | 9 ms | "Connection closed" | "Not connected" | "Not connected" |
| TypeScript SDK, limit raised to 256 MiB | 7.9 ms | 200 ms | 6,331 ms | 13.5 ms |
| TypeScript SDK, linear read buffer | 7.7 ms | 47.6 ms | 224 ms | 5 ms |
| rmcp, default limit | 8.4 ms | 51 ms | no answer in 30 s | 31.7 ms |
| rmcp, limit raised to 256 MiB | 8.7 ms | 52.1 ms | 260 ms | 5.2 ms |
The TypeScript SDK grows with the square of the message. Its ReadBuffer appends every chunk from the pipe with Buffer.concat, copying everything received so far, and then searches the whole buffer from the start for a newline. A message that arrives in k chunks costs about k² bytes of copying and scanning: 5 times the data took 32 times as long. The linear row is the same SDK with ReadBuffer patched in bench/mcp-sdk-client.mjs to keep the chunks in a list and search only the new one: 224 ms instead of 6,331. This is a known issue, #2961, with an open fix, #2965; until it ships, a 50 MiB result keeps the main process of a desktop app busy for seconds: 4.7 s in the Electron app here.
Its default limit ends the session. The stdio client refuses a message over 10 MiB. It does not fail that one call: it closes the transport, which ends the server's input and stops it, and the waiting call rejects with "MCP error -32000: Connection closed". Every later call fails with "Not connected". The limit counts the escaped line, not the tool's text, so the real ceiling is lower than it looks: with these rows, 8 MiB of text (a 9.0 MiB line) went through and 9 MiB of text (a 10.1 MiB line) closed the session. The real reason only reaches transport.onerror, which is #2775. The limit is the maxBufferSize option of StdioClientTransport, from electron-app/main.js:
async function connectMcp() {
const { Client } = await import('@modelcontextprotocol/sdk/client/index.js');
const { StdioClientTransport } = await import('@modelcontextprotocol/sdk/client/stdio.js');
const client = new Client({ name: 'electron-bench', version: '1.0.0' });
// Over 10 MiB in one message (STDIO_DEFAULT_MAX_BUFFER_SIZE), the SDK's stdio client closes the
// connection and stops the server; the caller only sees "Connection closed". MCP_MAX_BUFFER=default
// keeps that limit to show it.
const transport = new StdioClientTransport({
command: env.MCP_NODE ?? 'node',
args: [env.MCP_SERVER],
...('default' === env.MCP_MAX_BUFFER ? {} : { maxBufferSize: 256 * 1024 * 1024 }),
});
await client.connect(transport);
return client;
}rmcp is linear, and silent at its limit. rmcp read 50 MiB in 260 ms. Its default line limit is 16 MiB, added in 3.6.0 against a memory-exhaustion report; here 14 MiB of text (a 15.7 MiB line) went through and 15 MiB (a 16.8 MiB line) did not. A line over the limit is dropped with a log entry that nobody sees unless the app has a tracing subscriber. The session survives, so the next call works, but the dropped call is never answered, and rmcp's requests have no timeout by default (PeerRequestOptions::timeout is None). My 30-second timeout ended the wait; without one, the call would wait for as long as the app runs. A tokio::time::timeout around call_tool is enough: when the timeout drops the call, rmcp sends the server notifications/cancelled for it, and in my runs the next call on the same session worked. The server-side form of this is rust-sdk #1395. TokioChildProcess has no setting for the limit, so the Tauri app spawns the server itself and wraps its pipes, from tauri-app/src/lib.rs:
async fn connect_mcp(server: String) -> RunningService<RoleClient, ()> {
let mut child = tokio::process::Command::new(var("MCP_NODE", "node"))
.arg(server)
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.kill_on_drop(true)
.spawn()
.expect("MCP server starts");
let stdout = child.stdout.take().expect("stdout is piped");
let stdin = child.stdin.take().expect("stdin is piped");
let limit = match var("MCP_MAX_BUFFER", "").as_str() {
"default" => DEFAULT_MAX_LINE_LENGTH,
_ => 256 * 1024 * 1024,
};
let transport = AsyncRwTransport::new_client(stdout, stdin).with_max_line_length(limit);
// The child lives as long as the app; dropping it would kill the server.
Box::leak(Box::new(child));
().serve(transport).await.expect("MCP handshake")
}Both limits are there for a good reason: a stdio server is a separate program, and one that writes without a newline would otherwise fill the client's memory. Raising them, as both apps here do, trades that protection for large results. For an AI agent, the better fix sits upstream of the transport: a tool that can return 50 MiB should page its results, because no model reads 50 MiB of rows either. The Java SDK is a third variant of the same limit: its stdio client caps a message at 16 MiB, stops reading past it, and every later call times out, as I measured in an earlier article on MCP integration mistakes, which also shows a paged tool with a bounded limit in its schema.
One number in the Tauri app I cannot explain: returning the tool's text as a String instead of an ipc::Response took 957 ms, with calls between 510 and 1,651 ms, while the same String route without MCP took 284 ms. The Rust process peaked at 764 MiB on that route and at 637 MiB when it returned bytes, which took 383 ms.
What this means for a real app: Milo
Milo is a local-first API client I am building on Tauri, for my own daily work instead of Postman. It is not public yet. Two of its design decisions came from exactly the effects measured here, before I had measured them this carefully.
The first is that a response body never travels to the page whole. It stays in the Rust process, spilling to a temporary file above 10 MiB, and the page gets a handle and asks for what it shows: raw windows of the body come back as ipc::Response, and the JSON tree comes in pages of child nodes under a JSON pointer, rendered in a virtualised list. The first-100-rows route above is the measured version of that decision: the same 50 MiB, a page process at 22 or 23 MiB instead of 309 to 914.
The second is a memory budget, and here the honest number is less flattering. When I measured a freshly started Milo window in October, Activity Monitor showed about 102 MB: 24 for the Rust process, 57 for the WebKit page, 15 for the GPU process and 6 for networking. When I wrote this, the copy I use every day had been running for 10 days and 23 hours and took 221.8 MiB, of which 136.5 MiB was the WebKit page, whose lifetime peak was 357.7 MiB. A real React interface, a code editor and eleven days of responses cost far more than the framework's idle floor. The 26.5 MiB that Tauri saves over Electron at idle is real, and it is smaller than what the app itself grows into.
A puzzle: two results of the same size
The MCP server in this benchmark can also return the same rows as CSV. A client on the TypeScript SDK, with its default 10 MiB limit, asks for two tool results of the same size: 9,437,250 bytes of JSON and 9,437,206 bytes of CSV, both well under 10 MiB (10,485,760 bytes). One of them closes the session. Which one, and why does the other go through?
Answer: the JSON one. The limit applies to the JSON-RPC line, and the tool's text travels inside it as a JSON string. Every " in the JSON rows becomes \", which made the line 10,600,460 bytes: over the limit. The CSV has no quotes; only its newlines become \n, one extra byte per row, so its line was 9,494,905 bytes and the call returned normally. The size of what a tool returns says little about the size of the message that carries it.
What to reach for
- Pick Tauri for the disk size and the idle memory, not for start-up. 7.3 MiB against 268.7 MiB on disk, and 26.5 MiB less at idle. On this Mac, start-up was a tie.
- Serialise once. If the backend holds JSON text, as with an HTTP response or an MCP result, send it as bytes: in Tauri
ipc::Responseor a custom protocol, neverVec<u8>or a bigString; in Electron a string or aBuffer. If a Tauri backend holds structs, return them as they are. In Electron, never return a large object:JSON.stringifyit. A custom protocol is an endpoint that any page in the webview can fetch: answer only your own origin, not withAccess-Control-Allow-Origin: *as this benchmark does. - Better still, do not send it. Parse in the backend and send the page what it shows. It took about as long as the fastest full transfer and kept the page process at 22 to 23 MiB instead of hundreds.
- Send bytes through a Tauri
ChannelasChannel<Response>, neverChannel<&[u8]>, and signal completion in the data, not with the resolvedinvoke(). - If your app is an MCP client, check the client's limits before the framework's. Both limits count the escaped JSON-RPC line, about 12% more than the text here. Set the TypeScript SDK's
maxBufferSizeand the rmcp line length deliberately, put a timeout around every rmcp call, and on the TypeScript SDK keep large results under a few MiB until the quadratic read buffer is fixed. - Do not gate readiness on
requestAnimationFramein WebKit. Start work when the script runs; draw when the frame comes.
Scope and how this was checked
One machine, one webview. Everything ran on one MacBook Pro M1 Pro with macOS 27.2, so Tauri used the system WebKit. On Windows, Tauri uses WebView2, which is Chromium; on Linux, WebKitGTK. Memory, start-up and every IPC timing may differ there; I did not measure them. The machine was in normal use during the runs, which is one reason I report medians, and ranges where they matter. Routes were added to the apps between runs (the start-up marks, the held rows, the chunk size), so not every run used the same build; the code of a route did not change after it was measured.
An empty page, not an application. The page is a few lines of HTML, so the idle numbers are the frameworks' floor, not what an app costs; the Milo numbers show the difference. Start-up was measured on warm launches: the app files were in the disk cache, and I did not clear it between launches.
One kind of payload. All payloads are JSON arrays of ASCII rows. Text with many non-ASCII characters changes the cost of decoding and of strings in both engines; binary data that the page does not parse changes the balance entirely, because the parse is most of the time here.
How the numbers were checked. Every run is in runs/: startup.jsonl (memory, 40 launches), startup-times.jsonl (60 launches), ipc.jsonl (every route at three sizes), ipc-no-isolation.jsonl, ipc-held.jsonl, ipc-channel-chunks.jsonl, ipc-channel-resolve.jsonl, ipc-channel-raw.jsonl, startup-hidden.jsonl, the second run in replication/, the standalone client runs mcp-sdk.jsonl and mcp-rmcp.jsonl, and the limit runs mcp-limits.jsonl and mcp-csv.jsonl. Each IPC run checks that the page received the right number of rows and the same checksum as every other run. bench/report.py computes runs/summary.json from those files, the charts are drawn from that file by bench/charts.py, and bench/check_article.py checks every number this article quotes against it. The Milo snapshot is a single reading of a running app, in runs/milo-snapshot.json; Milo's code is not in the repository.
What comes from documentation or source code, not measurement: that Tauri serialises return values to JSON unless they are ipc::Response (Tauri's Calling Rust from the frontend) and how its Channel example ends a stream (Calling the frontend from Rust), that Electron's invoke uses the structured clone algorithm (ipcRenderer), that contextBridge copies values (contextBridge) and that context isolation and the sandbox are recommended defaults (Electron's security checklist), that a window created hidden paints and starts as visible, and that on macOS visibility follows occlusion (Electron's BrowserWindow documentation), that a Tauri Channel serialises any Serialize type to JSON (impl<T: Serialize> IpcResponse for T in Tauri 2.12.5), how the TypeScript SDK's ReadBuffer reads a line and how rmcp cancels a dropped call (their source, at the versions above), and the history of rmcp's line limit (its changelog and issue #1030).
A second run
Every number above comes from one run per route. To see which of them hold, I copied the repository without its build output, built both apps from scratch with the commands in its README (bench/replicate.sh), and repeated the headline measurements: memory with 5 launches per configuration, the 50 MiB routes and the two MCP clients alone. The fresh build also caught a bug of mine: I had removed the version field from the Electron app's package.json, and @electron/packager refuses to build without it.
| Measurement | First run | Second run, fresh builds |
|---|---|---|
| Idle, Tauri | 59.5 MiB | 60.3 MiB |
| Idle, Electron | 86.0 MiB | 86.0 MiB |
| Idle with an MCP client, Tauri | 58.8 MiB | 60.8 MiB |
| Idle with an MCP client, Electron | 102.7 MiB | 102.3 MiB |
50 MiB: Tauri, ipc::Response | 112 ms | 115 ms |
| 50 MiB: Tauri, custom protocol | 112 ms | 113 ms |
50 MiB: Tauri, parse and return Vec<Row> | 279 ms | 279 ms |
50 MiB: Tauri, Vec<u8> | 1,080 ms | 1,072 ms |
50 MiB: Tauri, Channel | 948 ms | 942 ms |
| 50 MiB: Tauri, first 100 rows | 125 ms | 109 ms |
50 MiB: Tauri, MCP result as ipc::Response | 383 ms | 369 ms |
| 50 MiB: Electron, string | 108 ms | 142 ms |
50 MiB: Electron, Buffer | 128 ms | 174 ms |
| 50 MiB: Electron, parse and return the object | 652 ms | 610 ms |
| 50 MiB: Electron, first 100 rows | 102 ms | 106 ms |
| 50 MiB: Electron, MCP result as a string | 4,662 ms | 4,428 ms |
| TypeScript SDK alone, 50 MiB, limit raised | 6,331 ms | 5,842 ms |
| TypeScript SDK alone, 50 MiB, linear buffer | 224 ms | 213 ms |
| rmcp alone, 50 MiB, limit raised | 260 ms | 267 ms |
Memory, start-up and every Tauri route repeated within a few percent, except Tauri's first 100 rows. Electron's fast routes did not: the string route took 108 ms in one run and 142 ms in the other, the Buffer route 128 and 174 ms, while the calls within each run stayed close together. So the fastest routes of the two frameworks are in the same range, and the order between them is not something one run settles. None of the article's conclusions depends on that order. None of the 20 start-ups in the second run, 10 per app, stalled.
TAURI is a trademark of The Tauri Programme within the Commons Conservancy. Electron is a trademark of the OpenJS Foundation. This article is not affiliated with or endorsed by either.