Readit News logoReadit News
Posted by u/katrinarodri 3 months ago
Show HN: I rewrote my Mac Electron app in Rustdesktopdocs.com/?v=2025...
A year ago, my co-founder launched Desktop Docs here on HN. It's a Mac app we built with Electron that uses CLIP embeddings to search photos and videos locally with natural language. We got positive feedback from HN and our first paying customers, but the app was almost 1GB and clunky to use.

TLDR; rebuilding in Rust was the right move.

So we rewrote the app with Rust and Tauri and here are the results:

- App size is 83% smaller: 1GB → 172MB - DMG Installer is 70% smaller: 232MB → 69.5MB - Indexing files is faster: A 38-minute video now indexes in ~3 minutes instead of 10-14 minutes - Overall more stability (old app used to randomly crash)

The original version worked, but it didn't perform well when you tried indexing thousands of images or large videos. We lost a lot of time struggling to optimize Electron’s main-renderer process communication and ended up with a complex worker system to process large batches of media files.

For months we wrestled with indecision about continuing to optimize the Electron app vs. starting a full rebuild in Swift or Rust. The main thing holding us back was that we hadn’t coded in Swift in almost 10 years and we didn’t know Rust very well.

What finally broke us was when users complained the app crashed their video calls just running in background. I guess that’s what happens when you ship an app with Chromium that takes up 200mb before any application code.

Today the app still uses CLIP for embeddings and Redis for vector storage and search, except Rust now handles the image and video processing pipeline and all the file I/O to let users browse their entire machine, not just indexed files.

For the UI, we decided to rebuild it from scratch instead of porting over the old UI. This turned out well because it resulted in a cleaner, simpler UI after living with the complexity of the old version.

The trickiest part of the migration was learning Rust. LLMs definitely help, but the Rust/Tauri community just isn’t as mature compared to Electron. Bundling Redis into the app was a permissioning nightmare, but I think our solution with Rust handles this better than what we had with Electron.

All in, the rebuild took about two months and still needs some more work to be at total parity with its Electron version, but the core functionality of indexing and searching files is way more performant than before and that made it worth the time. Sometimes you gotta throw away working code to build the right thing.

AMA about Rust/Tauri migration, Redis bundling nightmares, how CLIP embeddings work for local semantic search, or why Electron isn't always the answer.

yojo · 3 months ago
I recently went the other way (started a project in Tauri, moved to Electron) because of frustration with rendering differences between the web views employed on different platforms. Have you run into any cross platform UI bugs since you switched?

It looks like your UI needs are pretty simple while computation is complex so the extra QA tradeoff would still be worth it for you. I'm just wondering if my experience was unusual or if rendering differences are as common as they felt to me.

Also, did you go Tauri 2.0 or 1.0? 2.0 released its first stable release while I was mid-stream on v1, and migration was a nightmare/documentation was woefully inadequate. Did they get the docs sorted out?

CommonGuy · 3 months ago
We are using system webviews for https://kreya.app (not Tauri, but a custom implementation) and the platform differences are seldom a problem...

Polyfills fix most of the things and we are running automated end to end test on Linux, which catches most of the issues.

IMO the most difficult thing is figuring out how far the users are behind with their webview version, mostly on Linux and macOS. Windows has done thinga right with their WebView2 implementation

Sytten · 3 months ago
On the contrary it is a big big issue if you have a complex web app like we do. It was a PITA to deal with user bugs in a specific macos version with a 8y out of date webview.

And the performances of webkitgtk are horrible on Linux.

keysdev · 3 months ago
Yeah I was wondering how you dealing with the inconsistency of the different webviews? Are you using jquery? Or data star? Or is your own custom made polyfill depending on your user base?

TBH, a lite weight polyfill for most system webview would be refreshing change to all the spa frameworks out there.

pradn · 3 months ago
Wait - there's system webviews? On Mac, Windows, and Linux?

Edit: It looks like Tauri uses the following platform webview features.

https://github.com/tauri-apps/wry?tab=readme-ov-file#platfor...

leoh · 3 months ago
This looks fantastic! Any deets on the stack?
katrinarodri · 3 months ago
We actually haven't rolled out cross platform support yet with the Tauri version, so we will see how that goes. Our UI needs are simple, luckily. What kind of rendering differences were you seeing with Tauri? Was there one platform that worked the best/worst for your app? We'd love to support Windows next.

With the Electron version of the app, we had issues running our bundled binaries on Macs with Intel chip. That caused us so many headaches that we decided for the rebuild on Tauri that we wanted to focus on one platform first (Macs with Apple chip) before supporting other platforms.

We went with Tauri 1.4 and no issues so far. Will have to check out the docs for 2.0 migration and see what that looks like.

starkparker · 3 months ago
I worked with an open-source project that uses Tauri 1.x and their migration has been blocked with issues for months. It was a nightmare for the span I was involved in, and it looks like it hasn't moved forward since I stopped.

In particular, rendering and crashing issues specific to Linux have been blockers, but Tauri 1.x also has other rendering issues on Linux that 2.0 fixed. There's little to no guidance on what's causing the stability and new rendering problems or how to fix them.

The app I worked on was a launcher that installed and managed content for an app, and the launcher invoked the app through command-line flags. Those flags arbitrarily fail to be passed in Tauri 1.x but work as expected in Tauri 2.x, but nobody we asked about it knows why.

M4v3R · 3 months ago
Tauri 2.0 migration can potentially give you some more performance benefits, because they've greatly enhanced the JS-Rust bridge especially when you're moving lots of data.
yojo · 3 months ago
Nothing flat out broke, but I am developing and dogfooding on a Mac, so I get visual QA for free on that platform. When I tested my app on a Windows machine, I noticed several UI regressions that looked/felt really janky. I didn't get as far as testing a Linux build, but I assume I'd find more issues there.

I can't remember why I wanted to migrate to 2.0 now, but there was a nice-to-have that I couldn't do in 1.4. I ended up abandoning the 2.0 migration after a slew of cryptic errors, took a step back, and decided I'd be better off using Electron for my project. My app is at heart a rich UI text editor and none of the computation is that expensive. With all the value add coming from the interface, optimizing for consistency there feels right.

echelon · 3 months ago
> I recently went the other way (started a project in Tauri, moved to Electron) because of frustration with rendering differences between the web views employed on different platforms.

This is our #1 frustration with Tauri. The OS-provided system webviews are not stable, repeatable, consistent platforms to build upon.

Tauri decided that a key selling point of their platform was that Tauri builds won't bundle a browser runtime with your application. Instead, you wind up with whatever your operating system's browser runtime is. Each OS gets a different runtime.

Sounds nice on paper, but that has turned into a massive headache for us.

Safari and Edge have super finicky non-standard behavior, and it sucks. Different browser features break frequently. You're already operating in such a weird way between the tight system sandboxing and CORS behaviors (different between each browser), the subtle differences are death by a thousand cuts. And it never seems to stop stacking up. These aren't small CSS padding issues, but rather full-blown application behavior breakages. Even "caniuse.com" is wrong about the compatibility matrix with built-in web views.

To be fair, we're using advanced browser features. Animation, 2D contexts, trying to do things like pointer lock. But these are all examples of things that are extremely different between each web view.

All of this has doubled (quadrupled - with dev and prod builds behaving so differently! - but that's another story) the amount of physical testing we have to do. It takes so much time to manually test and ship. When we were building for the web, this wasn't an issue even if people used different browsers. The webviews have incredibly different behavior than web browsers.

Their rationale for using OS-provided system webviews instead of a bundled runtime baked into the installer at build time is that it would save space. But in reality all it has done is created developer frustration. And wasted so much freaking time. It's the single biggest time sink we have to deal with right now.

We were sold on Tauri because of Rust, but the system browser runtime is just such a bad decision. A self-imposed shotgun wound to the chest.

The Tauri folks have heard these complaints, and unfortunately their approach to solving it is to put Servo support on the roadmap. That's 1000% not the right fix. Servo is not even a production-ready platform. We just want Chrome.

Please just let us bundle a modern chrome with our apps. It's not saving anyone any headache with smaller programs and installer sizes. Games are already huge and people tolerate them. Lots of software is large. It's accepted, it's okay, it's normal. We have a lot of space, but we don't have a lot of time. That's the real trade off.

I want to use Rust. I want to use Chrome.

I hope the Tauri devs are reading this. It's not just from me. This is the general community consensus.

Built-in webviews are not the selling point for Tauri. Rust is.

krisknez · 3 months ago
I am a web developer and haven't used Tauri or Electron much yet.

I am wondering why rendering differences between different platforms are such an issue? When building web apps, you face the same challenges, so I would assume it wouldn't be much different.

yojo · 3 months ago
The promise of Electron is the version of chrome you develop on is the version that ships with your app. If it looks right on your machine, it looks right on whoever is running it. This is much nicer than when doing web development and deciding which browsers/browser versions to test and support.

Tauri does not bundle chrome with your app. This makes the bundle size much smaller. But the tradeoff is you end up rendering in whatever the default web view browser is. On Mac this will be some version of Safari (depending on MacOS version), and on Windows it will be some recent-ish Edge thing. Tauri actually has a nice page breaking this down: https://v2.tauri.app/reference/webview-versions/

This also means that a new OS release can change how your app is rendering, so a user can conceivably have a UI bug appear without updating your app.

fmbb · 3 months ago
Web developers building web apps for web browsers typically do not test cross browser compatibility.

They build in Chrome and test with Chrome and then the test of the week they whine about Firefox and Safari.

int_19h · 3 months ago
Web apps pretty much by definition don't do the kinds of things that desktop apps want to do. In the rare cases where they are actually on par feature-wise, it's just as much headache to support all the browsers in use, it's just that the functionality bar is so much lower on average.
no1youknowz · 3 months ago
Just recently Tauri announced:

> This year we've got a lot of exciting innovations in store for you, like CEF and SERVO based webviews...

From their discord.

pikdum · 3 months ago
Looking forward to either being stable. I like the idea of Tauri, but I need it to work well on Linux too.
mort96 · 3 months ago
Dealing with the rendering differences isn't any more difficult with Tauri than it is when making a normal web app, is it?
logankeenan · 3 months ago
With Electron, it will bundle chrome into the app so you only have to handle that single rendering engine. Tauri uses whatever is the default browser on the system the app is installed on
Klonoar · 3 months ago
No, WebkitGTK is notoriously an issue.
paxys · 3 months ago
Chrome has by far the most consistent cross-platform rendering.

Deleted Comment

cvburgess · 3 months ago
I had the exact same experience and switched from Tauri 2.0 to Electron after a month.

No only were there UI inconsistencies, but Safari lags behind chrome with things like the Popover API and the build/codesign/CD ecosystem for Tauri is incredibly scattered.

When I was using it, IAPs were still not really an option for Tauri or at least I could not find any docs or resources about it.

CreepGin · 3 months ago
Same here. We went with Electron mainly for consistency and stability. The larger bundle size wasn’t an issue for our particular project, so the decision was pretty straightforward.
rs186 · 3 months ago
> Have you run into any cross platform UI bugs

Of course not, it's only for Mac. If they were to support Windows and Linux, they probably would not have published this post.

Cross-platform UI is hard, even harder if you want to keep almost the exact same UI, same feature set across platforms, and potentially an online version. People moved from native applications to Qt to web stack for a reason.

Saying this as someone who works at a company that develops cross-platform desktop application that has millions of users. I can't imagine what my job would be like if we were using any other solution.

lionkor · 3 months ago
Not sure what you're saying; Tauri uses the native web view, it still ends up rendering a website. The differences in UI toolkits don't matter.
logankeenan · 3 months ago
Do you mean the actual rendering of html/css when you say rendering differences? Or are you referring more to differences in JS support?
yojo · 3 months ago
Pure html/css rendering. JS support could be addressed trivially in the build system by transpiling anything unsupported by the oldest likely target.
NoelJacob · 3 months ago
I'm curious how Tauri causes different views on different platforms because Tauri frontends are websites and if websites function same way on platforms so should the apps. If websites use something to hide browser differences so should the app developer on Tauri.

Dead Comment

andrewstuart · 3 months ago
You’re post honeymoon.

“We moved from X to Y and were so in love.” posts are often postcards from the honeymoon.

correa_brian · 3 months ago
We love it here. We're staying together forever
platevoltage · 3 months ago
The documentation for Tauri V2 was straight up trash when I last used it about 6 months ago. The project is very promising, but it was a huge pain getting some things to work with nothing to reference.

Deleted Comment

Deleted Comment

pjmlp · 3 months ago
I guess the Web would be all much better if ChromeOS Platform was everything that remained, who needs standards and multiple vendors.
charcircuit · 3 months ago
It's much more convient for developers for there to be a dominant to open source browser engine. Open source reduced the need for these standards and multiple vendors. See what happened with how Linux largely replaced the slew of UNIXes. The ability for everyone to contribute to a single project paired with the ability to customize it where needed to suit the product you are building has shown to be a winning model.
platevoltage · 3 months ago
I did the same thing with one of my projects. I built a simple webcam viewer that is optimized for USB microscopes as I couldn't find anything out there for this purpose. Basically all of the functionality was implemented in the renderer. As I was planning for App Store submission, I realized that a 500mb webcam viewer might not be the best thing. I decided to port it to Tauri V2 and got it down to about 15mb.
smusamashah · 3 months ago
What is the difference between Tauri and Electron. From what I understand both use browser for rendering, except electron ships the whole browser while Tauri use the browser already there on the system.
SpaceL10n · 3 months ago
That's part of it, but also Tauri uses Rust on the backend while Electron uses Node. Electron is way more mature with a larger developer community, but Tauri keeps gaining momentum. If memory safety, bundle size, and performance are important to you, Tauri is a nice choice. Electron is not bad but there's a reason there are so many new players.
bloomca · 3 months ago
Tauri uses native WebView (can be very outdated in old OS versions) and compiles to native machine code. Electron bundles full Chromium (rendering engine for HTML/CSS+V8 for JS) AND Node.js for your app code.

Honestly if there was an Electron without Node.js which would use literally any compiled language (although Rust is probably too low level), it would've been more tolerable.

platevoltage · 3 months ago
Exactly. Electron ships with a copy of chromium in every app, while Tauri uses the native WebView of the operating system.

Electron is also way more mature, but Tauri is improving.

correa_brian · 3 months ago
That's pretty sick. Nice work. What's it called? We're working on the app store submission this week.
platevoltage · 3 months ago
I ended up calling it Microscopic View. I made a webpage for it and everything.

https://microscopic-view.jgarrettcorbin.com

I got tied up with other projects while I was trying to navigate the submission process (it was my first time), so it's not up yet, but I'd be happy send you a build if you want to check it out.

itsibitzi · 3 months ago
Out of interest, how did you stream the video data to the frontend?
platevoltage · 3 months ago
I used MediaStream, which is part of the standard Web API

https://developer.mozilla.org/en-US/docs/Web/API/MediaStream

zalebz · 3 months ago
I'm neither a Mac uset nor is our team exploring a Rust rewrite ... however I appreciate this post. This is what I hope for from "Show HN", a just long enough summary of technical tradeoffs required to solve a real-world problem for a relatable small business (admittedly that part is an assumption). Thank you for sharing your experience.
katrinarodri · 3 months ago
Happy to share the experience. It was something we debated for a long time. Rebuilding something that is already kind've working is daunting, but in this case we are happy with the results.
sillyboi · 3 months ago
It would be great to see an up-to-date benchmark comparing modern cross-platform frameworks like Tauri, Flutter, Electron, React Native, and others.

Key metrics could include:

- Target bundle size

- Memory usage (RAM)

- Startup time

- CPU consumption under load

- Disk usage

- e.t.c.

Additionally, for frameworks like Tauri, it would be useful to include a WebView compatibility matrix, since the rendering behavior and performance can vary significantly depending on the WebView version used on each platform (e.g., macOS WKWebView vs. Windows WebView2, or Linux GTK WebKit). This divergence can affect both UI fidelity and performance, so capturing those differences in a visual format or table could help developers make more informed choices.

taroth · 3 months ago
Here's a great comparison, updated two weeks ago. https://github.com/Elanis/web-to-desktop-framework-compariso...

Electron comes out looking competitive at runtime! IMO people over-fixate on disc space instead of runtime memory usage.

Memory Usage with a single window open (Release builds)

Windows (x64): 1. Electron: ≈93MB 2. NodeGui: ≈116MB 3. NW.JS: ≈131MB 4. Tauri: ≈154MB 5. Wails: ≈163MB 6. Neutralino: ≈282MB

MacOS (arm64): 1. NodeGui: ≈84MB 2. Wails: ≈85MB 3. Tauri: ≈86MB 4. Neutralino: ≈109MB 5. Electron: ≈121MB 6. NW.JS: ≈189MB

Linux (x64): 1. Tauri: ≈16MB 2. Electron: ≈70MB 3. Wails: ≈86MB 4. NodeGui: ≈109MB 5. NW.JS: ≈166MB 6. Neutralino: ≈402MB

FINDarkside · 3 months ago
The benchmark also says Tauri takes 25s to launch on Linux and build of empty app takes over 4 minutes on Windows. Not sure if those numbers are really correct.
Abishek_Muthian · 3 months ago
I wonder the reason Tauri does great in Linux and Electron is at its worst is because of Optimization or lack thereof respectively.
rubymamis · 3 months ago
I've compared block editors (Notion - Electron, Appflowy - Flutter , etc) to my Qt C++ & QML block editor I've built in my blog post[1] using similar parameters. You might find it a good read.

[1] https://rubymamistvalove.com/block-editor

katrinarodri · 3 months ago
I'd love to see a comparison like this.
pier25 · 3 months ago
At a previous company we maintained a desktop electron app for Windows and macOS. It was super bloated though and updates with Squirrel were a pain.

We kept the GUI as a web spa app (using Inferno) and wrote two small native apps with C# and Swift that would load a webview and other duties. App download size and memory consumption was reduced by like 90%. We also moved distribution and updates to the app stores of each platform.

It was a great decision.

brulard · 3 months ago
This is the first time I see someone praising distribution and updates through native app stores. The time to get update to users and the uncertainty, that it gets through the approval process are just some of the reasons. I know nothing about Squirrel, but what were the things that improved moving to native?
pier25 · 3 months ago
I agree about dealing with Apple but having updates completely solved for us was a huge deal. We just didn't have the resources to solve this properly.

This was an app offered for free to some customers of the company. If the app had been the main commercial product we would have obviously opted for a better solution than distributing through stores or using Squirrel.

Back in 2018 we needed a server[1] that would notify Squirrel for the udpates. Squirrel worked ok on macOS but it was particularly bad on Windows. I don't remember the details... iirc Squirrel installed the actual executable in some weird folder and users would never be able to find the app if they deleted the link from the desktop.

[1] https://github.com/ArekSredzki/electron-release-server

correa_brian · 3 months ago
Nice. How long did the migration take?
pier25 · 3 months ago
It was trivial to create the apps with a web view. Then we implemented new features integrated with the OS that we didn't have before. This was back in 2018 so my memory is a bit fuzzy but I'd say in total 2-3 weeks of work. We definitely lost more time with Squirrel and Electron than that...
jdprgm · 3 months ago
- "Try" on the main LP call to action implies there is an available trial but just leads to a buy page. You really should have a trial, even something like just 1 week.

- Fan of the perpetual fallback licensing. Though $99 is a high barrier but i'm guessing you are targeting more creators/studios vs a more general consumer target (would think more like $20-25 for general consumer).

- You mention performance in this post but not at all on the landing page. The 38 minute video in the minutes would be very important to know for many potential customers. Would want benchmarks on various machines and info like parallel task processing, impact of and requirements around vram, etc. I would want an insight into what processing hundreds to thousands of hours of video is going to look like.

- I am curious how (and shocked) that electron itself was somehow responsible for a processing bottleneck going from 10-14 minutes to 3 minutes. Wasn't electron just responsible for orchestrating work to CLIP and likely ffmpeg? How was so much overhead added?

- I built (but never released) a similar type media search tool but based on transcriptions in Electron and didn't run into many performance issues

- Usually a lot of the motivation for building in Electron in the first place (or Tauri) would be cross platform, why mac only (especially for something like bulk media processing where nvidia can shine)

- I too recently went down the path of hadn't coded in Swift in 10 years and also investigated Tauri. I opted for Swift (for a new app not a re-write of something) and it has been mostly a pleasure so far and a dramatic improvement compared to my last swift app from around 2014 or so)

- If the LP section about active users is true it sounds like you've already found some modest success (congrats). Did you already have relationships/audience around the studio/creator space? Would be interested to hear about the marketing

correa_brian · 3 months ago
Appreciate the feedback! We haven't setup the infrastructure for a trial but maybe in the future.

That's cool you built a similar tool - what kept you from releasing it?

Plan is to ship a Windows and Linux version in the next few months if there's enough demand.

We've gotten our users through various launches on HN and reddit with some minimal linkedin promotion. It's been mostly word of mouth, which has been very promising to see.

Re: the electron and video processing performances - there's a lot to dive into. I don't claim to be an Electron expert, so maybe it was our misuse of workers that created a bottleneck. As part of the migration to rust we also implemented scene detection to help reduce the number of frames we indexed and this helped reduce processing loads a lot. We also added some GPU acceleration flags on ffmpeg that gave us meaningful gains. Batching processing image embedding generation was also a good improvement to a point, before it started crashing our model instance.

JohannMac · 3 months ago
Given your destination was the Mac app, why not Swift/SwiftUI rather than Rust/Tauri? Just curious is all.
correa_brian · 3 months ago
Thanks for checking it out. The goal is for Desktop Docs to be cross-platform. We've had a lot of requests for Windows support, so we chose Rust to set us up for an upcoming Windows version.
amendegree · 3 months ago
I know it’s probably still not ready for prime time, but I believe the arc browser team was building a windows runtime for swift bec they prefer to use swift everywhere.
rstupek · 3 months ago
Have you started your windows version testing? Any issues you've seen in the differences between browsers tauri would use on the different OSs?
burnte · 3 months ago
App looks great, I'm on Windows so I can't wait to see it!
mark_l_watson · 3 months ago
I wanted to ask the same question. Swift is a fairly nice language and seems to offer many of the benefits of Rust. As another commentator asked, I am also interested in details of integrating CLIPs.

I like the narrative, BTW, on why you needed to port your app.

correa_brian · 3 months ago
Thanks! Mentioned it on the other comment - but we're using the Ort crate in rust and bunlding onnxruntime with the app. Definitely considered Swift and I know it's gotten a lot better since I last used it, but cross-platform support was what got us to use Rust over Swift.

As far as porting over goes, we are much happier maintaining the new version.

ptsd_dalmatian · 3 months ago
Curious as well. I’m planning to build a desktop app, haven’t use swift for a long time and I’m pretty new to rust. Tauri looks very promising. I really don’t like electron apps. They’re so slow to start even on lightning fast machines. Thanks for any insights!
correa_brian · 3 months ago
After our Electron experience, I wish I had moved out of my comfort zone (JS) sooner. Electron just requires a lot of optimization and you have to be really tight with your imports to avoid loading things you don't immediately need.

The smaller bundle size with Tauri and blazing speed are well worth the effort.

abvdasker · 3 months ago
Honest curiosity — why did you choose a service like Redis over a more straightforward embedded solution like SQLite? In my head Redis seems better suited to distributed solutions but I've never actually built a desktop application so I'm probably speaking from ignorance.
LtWorf · 3 months ago
My bet is that he didn't know sqlite exists.