Early Gmail's Code Was Written by Another Program for Each User
He built a custom compiler to fit each browser and language, aiming to keep inbox actions under 100 milliseconds.

Standard Capital · How Paul Buchheit Created GmailIn Gmail's early years, the web code that ran the inbox was written by another program, customized for each user. That is how Paul Buchheit, the engineer who created Gmail, says it used to work.
Buchheit built a compiler that took his code and reissued it as leaner JavaScript. It checked for errors, tucked constant values directly into the code, and threw out anything unused.
It then tailored the result. A user got only the words in her own language and only the fixes needed for her browser, with variables shortened to a letter or two. Buchheit said he made the code as tight as possible, which made it difficult to read.
That thrift matched the rest of the design. He used one click handler for the whole inbox instead of one for each message, slimming the page structure. He timed actions obsessively, with the goal of keeping them under 100 milliseconds.
Questions people ask
What does a compiler do?
A compiler is a program that translates code written by people into code a computer can run efficiently. In this case, Buchheit wrote more readable code, and his compiler turned it into compact JavaScript, while catching mistakes along the way.
What is the DOM and why did its size matter?
The DOM is the browser's internal map of everything shown on a page, like text, buttons, and boxes. The bigger that map gets, the longer the browser takes to draw and update the page, which is why shrinking it made Gmail faster.
Why shorten variable names to a letter or two?
Shorter names mean fewer characters to send over the internet and store in memory. Across a large program used by millions of people, changing long descriptive names to one letter can save a meaningful amount of loading time.
