12 ms·
Aside from the other praise people have given Obsidian it is also by far the fastest electron app I've ever used by a lot. Curious if the devs have any insight
by spookyuser 5y ago
Aside from the other praise people have given Obsidian it is also by far the fastest electron app I've ever used by a lot. Curious if the devs have any insight how they have made it feel so performant.
- journey_16162 5y agoI'm not working on Obsidian, but I'm also building a desktop app with Electron now and a non-obvious performance tip is to offload things from the main process to a separate child process and use something like node-ipc to communicate. Especially if you use sqlite3 to store data (even though it has an API with callbacks, it's blocking). https://medium.com/actualbudget/the-horror-of-blocking-electrons-main-process-351bf11a763c https://medium.com/actualbudget/the-horror-of-blocking-elect... https://news.ycombinator.com/item?id=16616374 https://news.ycombinator.com/item?id=16616374 https://archive.jlongster.com/secret-of-good-electron-apps https://archive.jlongster.com/secret-of-good-electron-apps Also you may want to use Svelte rather than React. I'm curious myself if the Obsidian team has anything to share about this.
- chishaku 5y agoEverything changes when you ditch the network and store the database locally (markdown files and json metadata). I used Notion for years before Obsidian and the speed alone is a reason to never go back. On a related note, I also consider Linear to be quite fast and responsive especially when you learn the keyboard shortcuts. And to achieve that responsiveness, they load the whole database (or deltas) at startup.
- pwdisswordfish8 5y agoThe secret to development is to just follow classic programming patterns instead of new school "best practices" that are rife among the kinds of programmers who are creating Electron apps, and you should be good. In fact, JS is insanely fast, so you don't even need to do that. (Netscape 6, which came out 20 years ago, had tons of its parts written JS, down to the AOL Instant Messenger client it shipped with. It was essentially the forebear to every Electron app you see today, except it was supposed to run on computers with 64 MB of RAM, CPUs measured in hundreds of megahertz, and this was all fully interpreted, not JITted.) NodeJS development is so bad that you can appear to be nimble just by not sucking as much as the status quo. "You don't have to be faster than the bear..." A second thing you can do is not rely on a bunch of bloated, poorly written libraries just because they're popular—another "best practice", of a different sort. I.e., pretty much the opposite of this advice, ironically: <https://youtu.be/X61wRmfZU8Y?t=223 https://youtu.be/X61wRmfZU8Y?t=223>
- er4hn 5y agoCan you list out some classic patterns that you see being ignored?