Skip to main content
Preslav Rachev Preslav Rachev
  1. My Writings /Category /

gomjml v0.13.0 Uses Significantly Less Memory Than Before

·2 mins

I have just released a new version of gomjml - v0.13.0.

MJML - The Responsive Email Framework

MJML - The Responsive Email Framework

The only framework that makes responsive email easy. MJML is a markup language designed to reduce the pain of coding a responsive email.

https://mjml.io

Among some small improvements to the parser, the big difference is that future use will require significantly less memory. Sometimes, up to 35-40% less!

How did I get to such a dramatic reduction? Well, previous versions of gomjml rendered the body of every email twice. The first pass would figure out which fonts and styles belong in the document head. The second would produce the actual HTML. That extra copy of the body would be kept nowhere else, but in memory. If your application rendered an email or two every now and then, you would hardly notice the difference. At scale, however, all those cached contents will quickly start piling up, drastically increasing the memory consumption.

The new version still walks the component tree twice, but the first time, it only collects the minimum metadata needed for the second pass; then renders the body once, directly to the output.s

I like improvements like those. Even with no shiny new features to demonstrate. gomjml simply does less unnecessary work.

If you already use gomjml and care for performance, I’d suggest you consider an upgrade.

Have something to say? Join the discussion below 👇

or reply via

Want to explore instead? Fly with the time capsule 🛸