Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Sizes of JS frameworks, just minified + minified and gzipped, (React, Angular 2, Vue, Ember)

Below is the list of modern JS frameworks and almost frameworks – Angular, Ember and React.

All files were downloaded from https://cdnjs.com and named accordingly. Output from ls command is stripped out (irrelevant stuff)

As-is (minified)

$ ls -lhS
566K Jan  4 22:03 angular2.min.js
563K Jan  4 22:05 angular2.0.0-beta.0-all.umd.min.js
486K Jan  4 21:50 ember.1.13.8.min.js
435K Jan  4 21:48 ember.2.2.0.min.js
205K Jan  4 22:06 angular2.0.0-beta.0-Rx.min.js
144K Jan  4 21:59 react-with-addons-0.14.5.min.js
143K Jan  4 21:46 angular.1.4.5.min.js
132K Jan  4 21:56 react-0.14.5.min.js
121K Jan  4 21:35 angular.1.3.2.min.js
5.3K Jan  4 22:00 redux-3.0.5.min.js
706B Jan  4 21:57 react-dom-0.14.5.min.js
63K  Oct 13 03:02 vue-2.0.3.min.js
This gives us following approximations
Name Size
Ember 2.2.0 435K
Ember 1.13.8 486K
Angular 2 566K
Angular 2 + Rx 766K
Angular 1.4.5 143K
React 0.14.5 + React DOM 133K
React 0.14.5 + React DOM + Redux 139K
Vue 2.4.2 58.8K
Inferno 1.2.2 48K
Preact 7.2.0 16K

GZipped

$ gzip -r .
$ ls -lhS
123K Jan  4 22:11 ember.1.13.8.min.js.gz
119K Jan  4 22:11 angular2.0.0-beta.0-all.umd.min.js.gz
111K Jan  4 22:11 ember.2.2.0.min.js.gz
111K Jan  4 22:11 angular2.min.js.gz
51K Jan  4 22:11 angular.1.4.5.min.js.gz
45K Jan  4 22:11 angular.1.3.2.min.js.gz
42K Jan  4 22:11 react-with-addons-0.14.5.min.js.gz
39K Jan  4 22:11 react-0.14.5.min.js.gz
32K Jan  4 22:11 angular2.0.0-beta.0-Rx.min.js.gz
1.9K Jan  4 22:11 redux-3.0.5.min.js.gz
455B Jan  4 22:11 react-dom-0.14.5.min.js.gz
23K  Oct 13 03:02 vue-2.0.3.min.js.gz
Approximations for GZipped versions
Name Size
Ember 2.2.0 111K
Ember 1.13.8 123K
Angular 2 111K
Angular 2 + Rx 143K
Angular 1.4.5 51K
React 0.14.5 + React DOM 40K
React 0.14.5 + React DOM + Redux 42K
React 15.3.0 + React DOM 43K
Vue 2.4.2 20.9K
Inferno 1.2.2 20K
Preact 7.2.0 4kb

Also take a look at this awesome tool https://cost-of-modules.herokuapp.com created by @pastelsky

Thanks so much for compiling these and sharing them!

Owner

Restuta commented Jan 6, 2016

@coryhouse you are very welcome =)

nii236 commented Jun 3, 2016

How does React 15 compare to 0.14?

PhilippMeissner commented Jun 23, 2016 edited

You just saved me a good amount of time - Thanks!
Are you interested in adding more information to this, like the sizes of Elm or other popular/raising framworks?

As of today Angular 2 beta 17 minified is around 620kB.

https://cdnjs.com/libraries/angular.js/

In an age where everyone in the free world has ridiculous bandwidth, does the size of the javascript framework really matter? I do appreciate your efforts, and the size difference is interesting.

Owner

Restuta commented Aug 15, 2016

@keyboardSmasher it does for the world:

The average connection speed for Internet users worldwide, not just among these 50 countries, but all countries, is an average of 1.8 Mbit/s. As an average, this is actually pretty good, but as you’ve seen, there are plenty of extremes in either direction.

source http://royal.pingdom.com/2010/11/12/real-connection-speeds-for-internet-users-across-the-world/

Also browser has to evaluate JS and that is still kind of slow on mobile devices (https://meta.discourse.org/t/the-state-of-javascript-on-android-in-2015-is-poor/33889), so size is a good predictor of both, time to download and time to evaluate.

Owner

Restuta commented Aug 15, 2016

@PhilippMeissner probably not, but feel free to fork and do that. With Elm in particular I am not sure how to evaluate, since it's basically a compiler and not a library.

Owner

Restuta commented Aug 15, 2016

@nii236 15.3.0 is 43K gzipped

angular2 is a graller

mjdude commented Aug 24, 2016

Thanks for compiling this. It's really informative.

noahcollins commented Sep 1, 2016 edited

@keyboardSmasher even if most of your users have fast connections, fitting your render-critical bytes under the ~14KB TCP CWND threshold means no round trips to finish downloading the main payload. That's the top of your document, your critical CSS, and any critical app JS (if you're not rendering on server) -- all in about 14KB. The outcome is much quicker first paint and first useable paint. I find projects like preact and inferno to be very interesting for this reason.

All users regularly experience transient latency spikes, dropped packets, and so on. Browsers do a great drop masking network issues where they can, but if your "critical" bundle is large enough to require two, three, or more TCP round trips, your high-percentile render times will spike up accordingly. With an optimized bundle, you minimize the performance impact caused by varying network conditions and narrow the gap between your median and 90th percentile render times.

And to @Restuta's point, JS is expensive on mobile. The less JS that needs to be initially evaluated, the better your users' load times and battery life.

@noahcollins Thanks for this interesting addition. Could you point me to more information about the transition window size? I found a lot of documentation and RFCs but I wonder how you got to the 14KBs. All I found was that it is calculated, not static.

GabrielDelepine commented Sep 7, 2016 edited

here @mgechev (Angular 2 core dev) explain how to produice a "Hello world" with Angular 2 under 50ko.

@keyboardSmasher depends on what your target audience is. In a country like India, your statistics are pretty screwed up, where there are 60kbps connections an average and a city's target audience greater than some country's, these factors play a role.

Meteor?

Thank you for sharing 👍

Owner

Restuta commented Nov 5, 2016

@ShaggyDude feel free to PR, have no idea about Meteor.

Owner

Restuta commented Nov 5, 2016

@shshaw added

Backbone?

pitaj commented Dec 1, 2016

FYI you left out Vue from the top table

Mirodil commented Dec 7, 2016

aurelia?

Thank you !

Beautiful

When whole app is made live then it will have other files as well in which business logic is implemented so I think that size of framework is just like adding a swimming pool to the river, and thinking about whether to add public swimming pool or olympic swimming pool.
The point I'm making is that it will not make any big difference to the water-level of river.
Correct me if I'm wrong.

Owner

Restuta commented Dec 19, 2016

@NishantDesai1306 correcting you, since you are wrong :) it depends on your app of it's a river or a small water drop. In my experience there are a lot of small/medium sized apps where extra 50-200 on makes a difference. Also framework size correlates with time it takes to evaluate this JS code when it's loaded by browser.

Also this is not the right place to debate if the size matters for some/most apps, its vice versa, of you think it is — this is a useful gist for you.

What about Angular 2 without the compiler.
In a real world scenario you would use ahead of time compilation:
https://www.youtube.com/watch?v=_VnV7R4Ncwc

thovo commented Jan 3, 2017

Many thanks! Please allow me to use the number in my presentation! May we get an update on the size of each framework now?

Owner

Restuta commented Jan 5, 2017

@majorscuffy can you provide me with cdnjs link to a bundle you are referring to?

Owner

Restuta commented Jan 5, 2017

@thovo sure go ahead, can't promise update, but I can update the gist from your fork (if you'll create one)

variable-content commented Jan 21, 2017 edited

@Restuta For Angular 2, clone this repo: https://github.com/blacksonic/angular2-aot-webpack, and run npm i && npm run build. It produces a slightly sub-optimal build that produces two app js files totaling 370kb, 90kb gzipped.

Also, I don't think it's accurate to include the examples with the Angular 2 + the entire RxJs library, the entire RxJs API is quite large and apps just need to include the functions they use, which is usually a much smaller subset of the entire library.

FGM commented Jan 26, 2017

Would be interesting to have at least one version of jQuery / jQuery mobile as a legacy starting point for comparison.

Owner

Restuta commented Feb 6, 2017

@FGM why?

Owner

Restuta commented Feb 6, 2017 edited

@variable-content pre-compiled and tree-shaked bundles are beyond the point of this comparison. I am not sure why it's unfair, I took official bundle from CDN, is it a wrong one?

Baira commented Feb 12, 2017 edited

Can you add preact and inferno please ? Also would love to see mobx combinations instead of RX

@Baira

Inferno 1.2.2 downloaded from the unpkg site on https://infernojs.org/docs/guides/installation

$ ls -lSh
total 48K
-rw-r--r-- 1 karl karl  24K Feb 15 10:08 inferno.min.js
-rw-r--r-- 1 karl karl 9.3K Feb 15 10:08 inferno-router.min.js
-rw-r--r-- 1 karl karl 4.0K Feb 15 10:08 inferno-component.min.js
$ gzip -r .
$ ls -lSh
total 20K
-rw-r--r-- 1 karl karl 9.0K Feb 15 10:08 inferno.min.js.gz
-rw-r--r-- 1 karl karl 3.6K Feb 15 10:08 inferno-router.min.js.gz
-rw-r--r-- 1 karl karl 1.6K Feb 15 10:08 inferno-component.min.js.gz

Preact 7.2.0 from cdnjs

$ ls -lSh
total 16K
-rw-r--r-- 1 karl karl 9.2K Jan 23 14:03 preact.min.js
$ gzip -r .
$ ls -lSh
total 4.0K
-rw-r--r-- 1 karl karl 3.9K Jan 23 14:03 preact.min.js.gz

What all do we need with Vue to make it complete framework like Angular2?

The lastest available Vue.min.js (v.2.2.0) is now 74K in size. Maybe you want to add that to the list or update the 2.0.3 entry from above?

Hello world on Angular 2 with Angular Cli right now 76kb

I made a small tool that'll let you query the bundled size (min + minzipped) of any such npm library -
https://cost-of-modules.herokuapp.com

@pastelsky - Thanks a lot for this tool! Just what I was looking for.

jwhazel commented Apr 24, 2017

@pastelsky Thanks but app seems to be down?

evanjmg commented Apr 26, 2017

Angular with AOT is around the same size of React now 48kb gzipped

@Restuta can you include Angular 4 version? In official Angular page says

Smaller & Faster

Let's see if is it true or not ;)

Thanks!

kavoos commented May 1, 2017

Hi, I want the size of Angular v2.4.9. Which version should I pick from https://cdnjs.com/libraries/angular.js/?

@jwhazel should be up now.

can you update the list, because angular is no longer in beta but in version 4 with AoT and so on

anjmao commented Jun 19, 2017

There is example for angular 4 hello world app with closure compiler https://github.com/angular/closure-demo where Hello World app is 36kb.
I also added http and router modules for more real world scenarios and it was only 49kb.

Owner

Restuta commented Jul 28, 2017 edited

@pastelsky thank you for the tool, added it to the gist

Owner

Restuta commented Jul 28, 2017 edited

@anjmao would you mind providing closure compiler versions of React, View and Ember? I see no point in posting just Angular.

If you ever come to NYC, a beer is waiting for you! What an outstanding resource. Thank you!!

It seems like Angular 2 is much better than the rest, as it has more support, easy to learn and more configurable. Still, the biggest disadvantage is that it has dirty checking compromises performance and longer development time. Some programmers also say, that Angular is good for making only small application. At the same time, Ember has a lot of advantages. Some programmers have problems with learning it, but it uses accessors for better performance and the development time is much better than Angular’s one. As for React, it is a library and it must be used with other framework in combination, which makes it harder for beginners. We have also done the Angular and Ember comparison on our website: https://mobilunity.com/blog/ember-js-vs-angularjs-developers-2-business-models-to-build-a-team/

@Mobilunity-Com A few corrections on your comment...

  1. Angular is not used for small projects. The primary use case it covers is for large, team-based SPAs.
  2. Accessors are not limited to Ember and all of the major FE frameworks leverage them using different syntaxic sugar.
  3. Developer UX is highly subjective and is dependent on numerous factors which require coverage beyond your shallow conclusions.
  4. And clearly, you comment was a troll to drive traffic to your article. But based on your poor generalizations, it probably isn't worth reading (certainly I won't).

People, as a general rule: experiment and measure! You know your requirements, performance budget, target platforms/devices, timeline, etc. Choose what works best for you as an individual and/or your team. Don't blindly accept technical advice from trolling 3rd-party commenters.

djedi commented Sep 20, 2017

Where is Aurelia?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment