emberjs / ember.js

Ember.js - A JavaScript framework for creating ambitious web applications
https://emberjs.com
MIT License
22.47k stars 4.21k forks source link

3.11 increased ember-source filesize (~7kb) #18151

Closed makepanic closed 4 years ago

makepanic commented 5 years ago

It seems like 3.11 increased the ember-source dist/ember.min.js size:

version size in bytes
3.10.0 415300
3.11.0 422050
[{
  "3.10.0": {
    "version": "3.10.0",
    "time": "2019-05-13T20:41:53.602Z",
    "size": {
      "raw": 415300,
    }
  },
  "3.11.0-beta.1": {
    "version": "3.11.0-beta.1",
    "time": "2019-05-14T02:37:19.525Z",
    "size": {
      "raw": 421529,
    }
  },
  "3.11.0-beta.2": {
    "version": "3.11.0-beta.2",
    "time": "2019-06-03T20:07:24.587Z",
    "size": {
      "raw": 421564,
    }
  },
  "3.11.0-beta.3": {
    "version": "3.11.0-beta.3",
    "time": "2019-06-11T11:04:23.517Z",
    "size": {
      "raw": 422035,
    }
  },
  "3.11.0-beta.4": {
    "version": "3.11.0-beta.4",
    "time": "2019-06-18T05:53:59.727Z",
    "size": {
      "raw": 422041,
    }
  },
  "3.11.0": {
    "version": "3.11.0",
    "time": "2019-06-25T03:53:05.991Z",
    "size": {
      "raw": 422050,
    }
  }
}]

looks like this when plotted:

20190626-220614

rwjblue commented 5 years ago

Thanks for reporting! Do you happen to have the prod and min+gz sizes handy also?

rwjblue commented 5 years ago

I think next steps here would be to diff the ember.prod.js files between 3.10 and 3.11 so we can see whats going on.

makepanic commented 5 years ago

ember.prod.js

20190626-220625

{
  "3.10.2": {
    "version": "3.10.2",
    "time": "2019-06-18T14:06:08.009Z",
    "size": {
      "raw": 1778999,
      "gzip": -1
    }
  },
  "3.11.0-beta.1": {
    "version": "3.11.0-beta.1",
    "time": "2019-05-14T02:37:19.525Z",
    "size": {
      "raw": 1819144,
      "gzip": -1
    }
  },
  "3.11.0-beta.2": {
    "version": "3.11.0-beta.2",
    "time": "2019-06-03T20:07:24.587Z",
    "size": {
      "raw": 1819186,
      "gzip": -1
    }
  },
  "3.11.0-beta.3": {
    "version": "3.11.0-beta.3",
    "time": "2019-06-11T11:04:23.517Z",
    "size": {
      "raw": 1820362,
      "gzip": -1
    }
  },
  "3.11.0-beta.4": {
    "version": "3.11.0-beta.4",
    "time": "2019-06-18T05:53:59.727Z",
    "size": {
      "raw": 1824611,
      "gzip": -1
    }
  },
  "3.11.0": {
    "version": "3.11.0",
    "time": "2019-06-25T03:53:05.991Z",
    "size": {
      "raw": 1824623,
      "gzip": -1
    }
  }
}
rwjblue commented 5 years ago

Just did a quick diff of ember.prod.js between 3.10.1 and 3.11.0, looks like the main issue is that the feature flags aren't being stripped (whoops I was just misreading the diff). Not sure what's up yet, will have to dig in in the morning...)

rwjblue commented 5 years ago

OK, tried to do a better job of reading the diffs. Looks like there are a few categories of things that are making the 3.11 assets larger:

  1. {{on}} and {{fn}} landed for the first time, introducing a decent amount of new code (not a bug per-se)
  2. Some of the support code for tracked properties seems to be present but not guarded in feature flag guards.

Everything else looks pretty good. I think 1) is "fine", but we can definitely do something about 2).

rwjblue commented 5 years ago

Looks like @makepanic has revived and published an updated ember-source size tracker:

I've rebuild the old ember-size-tracker (https://github.com/ilkkao/ember-size-tracker) to use the ember-source npm package and deployed it on github: https://makepanic.github.io/ember-size-tracker/ You can find the source at https://github.com/makepanic/ember-size-tracker

While the size of ember.prod.js has gone up, the size of ember.min.js with gzipping has gone down. If compression still treats us favorably and the "in reality" sizes are lower, I think this is probably a non-issue.

Thoughts?

makepanic commented 5 years ago

the size of ember.min.js with gzipping has gone down

I'm not sure if that's true. From the source:

    "version": "3.10.2",
    "files": [
      {
        "size": {
          "raw": 415690,
          "gzip": 115419
        },
        "name": "package/dist/ember.min.js"
      },
    "version": "3.11.1",
    "files": [
      {
        "size": {
          "raw": 422073,
          "gzip": 117392
        },
        "name": "package/dist/ember.min.js"
      }

both sizes are larger in 3.11.x.

I've updated the graph to also highlight size changes

locks commented 4 years ago

Thanks everyone for the discussion. Due to the release schedule, I am closing this and suggest we focus the discussion in https://github.com/emberjs/ember.js/issues/18796, since we seem to have had another regression!