MetaMask / MetaMask/metamask-extension

Memory use and performance issues

Open
#12,508 1 comment 2 reactions 0 assignees View on GitHub
area-performance type-refactor
Dominant language
TypeScript
Stars
13.2k
Forks
5.6k
Avg merge
2d 5h
Merged PRs (30d)
451

Description

**Describe the problem**

Metamask extension JS bundles are huge - 5.8 MB of combined weight, even though the files are minified. This size is quite unusual for a web app. Granted, the files are not gzipped or brotlied because they're served from FS, but even with this caveat, the size is hard to justify.

What's more, all JS bundles are requested on load, instead of being requested dynamically when needed.

This results poor load performance, serious memory use, and suggests that the current situation could be improved.

**Screenshots**
metamask-huge-bundles

Memory use compared to some other wallets:
metamask-memory-use

**Expected behavior**

Metamask is embedded in a browser and has access to the latest JS features. I expect to see a more modern approach, where necessary modules are loaded dynamically and the memory usage is minimized.

**Browser details (please complete the following information):**
- OS: Mac OS
- Browser: Chrome Version 95.0.4638.54 (Official Build) (x86_64)
- MetaMask Version: 10.2.2

---
I'm not in expert in what Metamask has under the hood. I'm interested in knowing whether some of this weight is unavoidable. The UI alone isn't complicated and can be implemented with kilobytes of javascript, not megabytes.

Contributor guide

Open the contributing guide

Research direction

Start by measuring the extension's JavaScript bundle sizes, startup requests, and memory use in the reported Chrome and MetaMask versions. Compare which bundles load immediately and establish before-and-after measurements; done means unnecessary initial loading is reduced and memory and load performance improve.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend, performance
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.