News for hackers. Stuff that matters.
Re:SQLite as an Application File Format (2014) by ori_b on Saturday June 13, 2020 @01:06PM (#23510865)
> If you have an FPS or interactivity target that needs to be guaranteed to be better than about 0.1-1 second - depending on platform - you can't have any disk IO at all on the UI thread, or any thread that's supposed to react at interactive rates at all times.

Yes, and other file formats encourage doing things in memory, so you don't have any disk i/o in the common path.

Using sqlite as a file format strongly discourages the simple, jank-free until you press save workflow of slurping your content, operating on it in memory, and then outputting it all in one operation as a response to an explicit user action. Instead, your whole application gets small but perceptible delays across all operations and interactions.

Re:SQLite as an Application File Format (2014) by lxdesk on Saturday June 13, 2020 @02:58PM (#23511746)
That conflates the use of the schema with the use of the format features. You can, in fact, use your custom in-memory structures and then "slurp it out" to BLOB when you're ready to save.
Re:SQLite as an Application File Format (2014) by ori_b on Saturday June 13, 2020 @03:02PM (#23511785)
Yes. But if you go that way, though, sqlite is just a slow and clunky format compared to, eg, json or protobuf. I doubt that any program out there uses sqlite this way, other than those which realize they painted themselves into a performance corner and hacked around it for compatibility.
Re:SQLite as an Application File Format (2014) by em500 on Saturday June 13, 2020 @01:57PM (#23511258)
Your concerns seem pretty theoretical. Several very widely used applications (Whatsapp, iMessage, Apple Notes/Calendar) use sqlite as a file format without much issue.
Re:SQLite as an Application File Format (2014) by ori_b on Saturday June 13, 2020 @08:42PM (#23514128)
It's also recommended against by Firefox because it's been causing performance issues: https://wiki.mozilla.org/Performance/Avoid_SQLite_In_Your_Ne...
Re:SQLite as an Application File Format (2014) by sdinsn on Saturday June 13, 2020 @09:56PM (#23514494)
It's funny you use that as an example, since Firefox itself uses SQLite as the application file format for history and bookmarks...
Re:SQLite as an Application File Format (2014) by ori_b on Sunday June 14, 2020 @01:04AM (#23515256)
Yep. if you read it, that page is basically their experience report with that decision.
Re:SQLite as an Application File Format (2014) by sdinsn on Sunday June 14, 2020 @09:21PM (#23522944)
> their experience report

It's not "their" experience report.

Re:SQLite as an Application File Format (2014) by ori_b on Monday June 15, 2020 @05:49PM (#23533420)
I see. Then how did it get on their site?