Readwyn 0.1.0

A Mac ebook library of 10,000 books: what the measurements show

With 10,000 books, Readwyn took 222 ms from a cold start to the first frame of the library, in a virtual Mac. Every screen switch in the test (the library, a book and its tabs, the reader, Notebook, Sync and Settings) took 71 ms or less, and so did every filter, sort and status tab. Scrolling and page turns never needed more than 16.7 ms for a frame, and an idle screen drew no frames at all. Two results miss their target: switching to the 10,000-book library from another library (131 to 149 ms), and one find in a book in the 10-book library, which took 269 ms in one run of three.

How it's measured

There are four test libraries, of 10, 100, 1,000 and 10,000 books. They're made from copies of real books, each with its own title, authors, language, series, dates, and cover image. Each has reading data as well: statuses, shelves, ratings, progress, last-read dates, and highlights on some of the books.

The measurements run the release build in a virtual Mac with 4 CPUs and 8 GB of memory, in a window of 1280 × 800 points at 60 Hz. Every timing starts when the app begins the switch, filter or sort, and stops at the end of the first frame that shows the result with its data. Covers decode after that frame and are not part of the time. A frame time counts the app's own work (drawing and presenting the frame), not the time spent waiting for the virtual GPU to hand back a free buffer to draw into. How busy the host Mac is changes the results inside the virtual one, so runs are only compared under the same load. The test libraries were not imported from calibre, and the import itself isn't measured.

The targets

  • Every frame takes 16.7 ms or less while you scroll or turn pages.
  • Every screen switch, filter, sort, and library switch takes 100 ms or less.
  • Every find in the reader takes 100 ms or less.
  • Idle CPU is below 1 % on every screen. When nothing changes, the app does not redraw.
  • Peak memory with 10,000 books is at most 1.5 times the peak with 100 books.

The results with 10,000 books

The library in the grid view: the status tabs, the Filter and Sort controls, and rows of covers
The grid view: with 10,000 books, its slowest frame while scrolling took 8.2 ms
Measurement100 books10,000 books
Cold start to the first library frame162 ms222 ms
Open a book29 ms30 ms
Open the reader52 ms67 ms
Slowest filter31 ms67 ms
Slowest sort31 ms62 ms
Slowest frame while scrolling the grid6.0 ms8.2 ms
Slowest frame while scrolling the list4.7 ms6.1 ms
Library grid, resident memory117 MB146 MB
Peak resident memory291 MB410 MB

The screen switches are the slowest of three visits, and the filters and sorts the slowest of three runs.

Scrolling and page turns

To test scrolling, the grid and the list each got one wheel event per frame for 5 seconds. No frame took more than 16.7 ms, in any library. The reader turned 12 pages with each animation (slide, cover, fade, curl, and flip). With 10,000 books, no frame took more than 12 ms.

Idle

After a screen settles, Readwyn draws nothing. On every screen and in every library, an idle period of 5 seconds drew 0 frames, and the CPU stayed at 0.35 % of one core or less.

Memory

A hundred times the books doesn't mean a hundred times the memory: the peak with 10,000 books, 410 MB, is within the limit of 436 MB, which is 1.5 times the peak with 100 books. After going round every screen three times, the app used 1.6 % more memory with 10,000 books than after the first round. The target allows 5 %.

What misses its target

  • A switch to the library of 10,000 books took 131 to 149 ms from the other libraries. Most of that is opening the library's store for the first time. Switching to the libraries of 10, 100, and 1,000 books took 26 to 58 ms.
  • One find in the reader, a Tamil word in the library of 10 books, took 269 ms. It was one slow run of three. The same find took 45 to 46 ms in the libraries of 100, 1,000, and 10,000 books.

What keeps it quick

Your data lives in an append-only log, and every read, search and sort goes through a SQLite cache built from it. The grid and the lists draw a small cover thumbnail rather than the full cover.