20 votes

Lessons learned from 15 years of SumatraPDF, an open source Windows app

4 comments

  1. joplin
    Link
    Thanks for sharing! There's a lot of great wisdom here. I found this highly ironic (not the author's fault): I installed the Amazon Kindle app for macOS several years ago. This was on a MacBookPro...

    Thanks for sharing! There's a lot of great wisdom here. I found this highly ironic (not the author's fault):

    This comes back to Jeff Bezos' wisdom: there will never be a time when users want bloated and slow apps so being small and fast is a permanent advantage.

    How do I keep SumatraPDF small?

    I avoid unnecessary abstractions. Window's system of controls is a giant pain in the ass to program against. I could use wrappers like Qt, WxWindows or Gtk. They are easier to use but cause instant, giant bloat.

    I installed the Amazon Kindle app for macOS several years ago. This was on a MacBookPro that was maybe 2 years old at the time. The app was written in Qt and was excruciatingly slow. Like you would go to turn a page and could count the seconds before it responded slow. So I pulled out Instruments and started profiling it. It was allocating and releasing a 40MB block of memory dozens of times per second. It seemed like it was redrawing the entire printed page 30 or 60 times a second and was allocating and releasing the bitmap for it each time instead of reusing it. (Both of those things are incredibly inefficient on their own, but together — ouch!) I believe they've since rewritten the app, but reading the reviews of it on the AppStore, others were experiencing the same pain at the time. So it seems that even Amazon doesn't listen to Jeff Bezos on this point.

    9 votes
  2. FlippantGod
    Link
    Neat article, I've used SumatraPDF already today. I always appreciated the small installer and how quick it renders. When I was first comparing PDF readers, it also seemed to render more...

    Neat article, I've used SumatraPDF already today. I always appreciated the small installer and how quick it renders. When I was first comparing PDF readers, it also seemed to render more accurately than some alternatives. IDK if that is true though, the article never mentioned it.

    One thing which surprised me was that the author attributes some of the success to supporting multiple formats, which seems contradictory to many of the other design points. I also forgot I use it for everything other than PDFs, too, including this morning. Haha...

    Something neat was the mention of Plan 9's C headers. I'll look into that I guess. The author also takes quite an unconventional approach to tests... Well, it is food for thought if nothing else. Thanks for posting this Apos.

    3 votes
  3. [2]
    cancycou
    Link
    I've been using Sumatra PDF for many years now. Definitely one of, if not the best PDF reader in my opinion.

    I've been using Sumatra PDF for many years now. Definitely one of, if not the best PDF reader in my opinion.

    2 votes
    1. Apos
      Link Parent
      Indeed! What I like most about it is that it can reload a PDF automatically without losing the scroll location. I can write my LilyPond music sheets and have the sheet preview always update....

      Indeed! What I like most about it is that it can reload a PDF automatically without losing the scroll location. I can write my LilyPond music sheets and have the sheet preview always update. https://github.com/Apostolique/rust-lilypond-invoke-editor.

      1 vote