4 ms·
Take a particularly bad example: Gmail uses over 150MB of RAM, and achieves similar results to what FastMail does with 11MB. The main difference is that Gmail i
by chrismorgan 8y ago
Take a particularly bad example: Gmail uses over 150MB of RAM, and achieves similar results to what FastMail does with 11MB. The main difference is that Gmail includes the Hangouts chat system—and indeed, last time I checked Hangouts was responsible for most of the megabytes downloaded, most of the time spent and most of the memory consumed. Suppose then we decide to let Hangouts off scot-free for its profligacy, calling it 50% of the footprint, and just focus on comparing the email part of the system.
Gmail is still using an estimated 80MB for what FastMail needs only 11MB for.
Where is this 80MB coming from? Is it caching 80MB of emails? I think not. You’ll be lucky if that 80MB corresponds to even half a megabyte of email.
Most high memory usage is not because it’s caching things so it can work fast. Most high memory usage is simply because the app is inefficient.
- pathartl 8y agoI'd be interested to see how the offline capability of Gmail ties into this. Whatever it uses, localstorage or service workers or whatever, it does a pretty dang good job.
- chrismorgan 8y agoI can’t speak about how Gmail’s offline functionality works, but I would expect it to be broadly similar to the basic approach we’re planning on in FastMail, which is that you start by simply adding a persistent cache. There’s already a robust object syncing protocol in place (JMAP), and you already have what amounts to simple tables (Mailbox, Email, CalendarEvent, &c.), so all that’s really changing is that you’re moving most of that cache onto disk rather than keeping it in memory. Most likely, content is moved out of the JS heap into an IndexedDB. I’m not sure what the memory characteristics of IndexedDB are yet, but at least theoretically that should be memory that can easily be freed, because it’s all flushed to disk. There’s the possibility that the browser may keep more in memory than is necessary, but I would actually expect memory to be a little lower in the presence of service workers, rather than higher.