Tulio Paschoalin Leao

The Walking Load: a hypothesis on MEC Livros slowness to load comic book pages

· Tulio Paschoalin Leao · 7 min

Introduction

Roughly three months ago, the government of Brazil launched Mec Livros, a free online platform for reading books that all Brazilian citizens can use. I didn’t pay much attention to what the catalogue was, as I assumed it would focus on educational books to assist people enrolled into schools or universities, and wrong was I. Thanks to a friend1, I found out it contains fiction, poetry, non-fiction and even comic books, and it’s not limited to Brazilian authors2 so I gave it a chance and highly recommend you do too34!

The image shows a screenshot of the "*Mec Livros*" Android app showing 9 book covers ranging from well known Marvel comic books up until classics such as Frankenstein.

Mec Livros” app on the comic book category

I stumbled upon Tom Gauld’s “Mooncop” and gave it a read. It’s a comic book about a guy working as a policeman in a small moon colony where nothing happens. It is simple, light-hearted and captivating. I found it delightful and given I had never heard about the author, decided to try another of its books that was also available on the platform, “Goliath”.

Book cover of the Mooncop title, by Tom Gauld. It's a minimalist drawing showing a small man in a space suit walking alone on the moon's surface.

Mooncop, by Tom Gauld

A hint of bad experience

While the experience to read “Mooncop” on the app was seamless, it was not the case for “Goliath”, as the book pages were excruciatingly slow to load:

A short gif showing how the comic book strips were loading very slow, taking tens of seconds to render a full page.

The video is 3x faster than the original recording and it still shows how slow it was

I was perplexed because every condition was the same: the phone, the 5G connection, the author, the drawing style, even the number of pages! Just a few minutes later, my experience went from blissful to disastrous and this is one thing that could make people abandon the app and not try it again, the opposite of what they are going for, so I decided to mail them5. They responded very quickly6, here’s how it looked like:

Tulio: Hi, I’m reading “Goliath” and it is very slow to load. It wasn’t the case for “Mooncop”, from the same author, so I think the book might not be optimized for reading.

Support: We see you have a question on how to borrow books. The one you are trying to read currently doesn’t have a copy available, so you should wait.

Tulio: That’s not my problem, I already have a borrowed copy, but it is too slow to render.

Support: Thanks for reaching out and sharing your experience. Could you tell us more about what is happening?

Tulio: 😮‍💨 (repeats the same things) and here’s a recording showing the problem.

Support: Thanks! We will route to the appropriate team.

It looked a lot like automated and delayed AI-written responses over e-mail, rather than being a chatbot, so I was not confident the issue would be routed nor sorted.

Examining “Mec Livros” slowness

I decided to investigate on my own and saw the same slowness I was seeing in the app on the computer browser, but it eventually improved and I could finish the reading. A normal person would have stopped there7, that’s not me though, so I used some debug tools8 and found out each page was being downloaded as a separate image with some of them being inexplicably heavy.

I assumed this was the reason for the slowness, despite having a good mobile connection and a new phone as I had seen this bad rendering elsewhere when browsing heavy PDFs for board game rules. With both books being from the same author, art style and length, it made for a very good comparison experiment, so I picked three different pages from the beginning of the book to do so:

Goliath’s second page was almost 5 times heavier than Mooncop’s and it was just a red rectangle compared to a blue one, they should “weigh the same”9.

A rectangle showing a red page at the top and a blue one at the bottom, recreating the look and feel of Goliath and Mooncop second pages.

How Goliath (top) and Mooncop (bottom) page 2 colors looked like

The difference got starker when we compared the first page with comic strips though, with “Goliath” being up to 8 times heavier and taking up around 2.5 MB. Fully reading this single, small comic book, could use 1% of the data someone has per month10. This is not acceptable for an initiative supposed to make books more accessible.

I played around with the online Caesium Image Compressor to see if I could get the images to be smaller, without losing any information (lossless compression). I got ten times smaller files for the simple pages (2 and 3), but the gain was a meager 5% for the comic strips, which didn’t help much. I then switched to lossy compression with 80% of the original quality and now the simple pages were 20x smaller and the comic strips 5x! This seemed like a huge win and, to my naked imperfect eye the pages still looked the same. Knowing my limitations, I used Diffchecker’s online image comparison11 to understand what was lost and here’s part of a result:

A side-by-side comparison of part of the Goliath book cover, showing where it changed, mostly losing some vividness in the colors.

Goliath original cover (left) and compressed (right)

With the tool, it is easy to see some color changes, losing some of its vividness, but the drawing looks mostly the same. What is more interesting though, is that while applying the “80% quality compresssion” gives a 5x boost to Goliath’s strips, it barely makes a difference for “Mooncop”. Here’s the combined total size of these pages for both books (original format, lossless compression and lossy):

A chart showing the total size of the three measured pages on both books, with Goliath seeing a big compression, but Mooncop not.

Size comparison of Goliath and Mooncop after destructive and non-destructive compression

This hints at “Mooncop” possibly being an already “lossy-compressed” version, since the algorithm didn’t do much, which is exactly what my original e-mail to their support team stated: “Goliath doesn’t seem like an optimized for reading copy”. It felt like a good point to stop wasting time investigating and writing up a post.

Wrap-up

The platform might not be to blame regarding the size of the books, since it is likely that they only deliver exactly what the publisher tells them to and that the publisher itself is handling the “wrong files”, but there is a lot they could attempt to possibly improve this situation:

Mec Livros looks like a great platform to get more people into reading, particularly because it doesn’t try to cater only to a specific genre or set of authors and I hope my modest e-mail to their support team and this article helps it become better!


  1. Hi Vivi! ↩︎

  2. Contrary to the other recently launched platform, Tela Brasil, which is for brazilian movies. ↩︎

  3. As long as you are a Brazilian or a foreigner with CPF and can access gov.br 😂 ↩︎

  4. This is not pro-government advertisement, but one has to recognize good initiatives and since I’m not a public servant nor subject to the electoral restrictions, I can speak my mind 😋. ↩︎

  5. If you haven’t realized by now, I’m the annoying person that always spends time going after things, even if everyone else would say it’s a useless effort. ↩︎

  6. Same vibes as “the fast at math joke”, where the person is fast, just not correct. ↩︎

  7. Both in investigating and in reading, since the app only allows you to borrow two books per month hahaha. ↩︎

  8. It was not at all complex nor hacker-ish, but I’m intentionally not disclosing the steps to avoid potentially getting into trouble. ↩︎

  9. Ideally next to nothing, since it’s just a single color throughout the whole page. ↩︎

  10. Considering the cheapest mobile data plan of Vivo, the biggest carrier in Brazil today. ↩︎

  11. A very cool feature by the way! ↩︎

  12. There will always be people arguing that they want to see “art as it was conceived”. ↩︎

#books #data-analysis

Reply to this post by email ↪