Skip to content

Instantly share code, notes, and snippets.

@felipeochoa
Last active April 7, 2017 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felipeochoa/6af5eaf368017dbcfde9d3830c6d6217 to your computer and use it in GitHub Desktop.
Save felipeochoa/6af5eaf368017dbcfde9d3830c6d6217 to your computer and use it in GitHub Desktop.
Bundle size in JS

Just built my app as a single bundle using Webpack, babel, and UglifyJS. It came out to 1,283,741 characters.

Here are the most space-consuming words in the resulting in the resulting bundle, how often they occur, and the total number of characters they take up:

word occurences chracters
function 8764 70,112
return 6501 39,006
this 6060 24,240
e 21536 21,536
default 3063 21,441
t 17006 17,006
var 5167 15,501
n 13543 13,543
prototype 1435 12,915
createElement 788 10,244
length 1671 10,026
Object 1594 95,64
r 9227 9,227
value 1623 8,115
arguments 839 7,551
null 1864 7,456
0 7315 7,315
typeof 1186 7,116
o 5539 5,539
defineProperty 394 5,516
if 2743 5,486
__esModule 451 4,510
void 1114 4,456
isRequired 440 4,400
i 4313 4,313
enumerable 402 4,020
a 3983 3,983
PropTypes 442 3,978
1 3904 3,904
strict 642 3,852
className 426 3,834
throw 745 3,725
new 1185 3,555
setPrototypeOf 248 3,472
exports 489 3,423
call 846 3,384
props 665 3,325
key 1053 3,159
getPrototypeOf 225 3,150
configurable 262 3,144
hasOwnProperty 222 3,108
__proto__ 345 3,105
payload 443 3,101
for 988 2,964
TypeError 327 2,943
object 479 2,874
instanceof 279 2,790
type 670 2,680
s 2643 2,643
l 2610 2,610

And the same thing, but for word pairs. (Note that each word is double counted since it shows up in two word pairs)

word-pair occurences chracters
function(e 3855 38550
default.createElement 720 15120
e){return 1353 12177
e,t 3823 11469
return e 1135 9080
function(){return 530 9010
value:function 584 8176
Object.defineProperty 388 8148
default.PropTypes 387 6579
void 0 1063 6378
use strict 635 6350
t,n 2113 6339
strict";function 370 5920
throw new 612 5508
for(var 758 5306
l.default 581 5229
Object.setPrototypeOf 246 5166
this.props 508 5080
var n 969 4845
t.prototype 437 4807
return function 316 4740
Object.getPrototypeOf 223 4683
function"!=typeof 273 4641
typeof t 575 4600
function(t 451 4510
var r 887 4435
n){"use 624 4368
t){return 484 4356
function r 434 4340
arguments.length 267 4272
function(){var 303 4242
return this 367 4037
__esModule",{value 223 4014
new TypeError 308 4004
c.default 429 3861
defineProperty(t 241 3856
return n 477 3816
e.exports 420 3780
return t 453 3624
var t 711 3555
getPrototypeOf(t 212 3392
__proto__ Object
default.colors 226 3164
function(){function 165 3135
function"==typeof 174 2958
t,"__esModule 223 2899
createElement("div 161 2898
e){var 478 2868
r.enumerable 236 2832
forEach(function 167 2672
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment