Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Babel loose #7452

Merged
merged 4 commits into from Jun 5, 2020
Merged

Babel loose #7452

merged 4 commits into from Jun 5, 2020

Conversation

kurkle
Copy link
Member

@kurkle kurkle commented Jun 1, 2020

  • Use loose mode for babel
  • Stop using Set, because its not handled properly in loose mode

Closes: #7448

Babel issue

@benmccann
Copy link
Contributor

It'd be helpful to document in the performance section that if you're using Babble with the ES6 build then you should use loose mode

@leeoniya
Copy link

leeoniya commented Jun 5, 2020

Stop using Set, because its not handled properly in loose mode

that's too bad. are you sure it's the use of Set rather than your spreading of it into an array? IE11 has Set support. you'd just need to forEach over it.

have you guys considered composition in lieu of classes (even without prototype or this). or something like:

function extend(parent, child, props) {
  child.__proto__ = parent;
  var proto = child.prototype = Object.create(parent.prototype);
  proto.constructor = child;
  for (var p in props)
    proto[p] = props[p];
  return child;
}

in uPlot i just stick to functions (most of them in a large instance closure) and have no issues with using Buble and the bundles are extremely compact. you have to avoid for..of and occasionally spreads, but those are really not on the usefulness level of e.g. async/await vs promises.

@kurkle
Copy link
Member Author

kurkle commented Jun 5, 2020

@leeoniya its the spread, but doing forEach with it removes the small speed gain it provides compared to simple object.

We've just about finished to conversion to classes, I doubt there are many volunteers to reverse that now. I testet buble and it created about the same code compared to babel loose, only 5kb bigger, because it did not alias this etc.

@etimberg etimberg merged commit 3c02846 into chartjs:master Jun 5, 2020
@etimberg etimberg added this to the Version 3.0 milestone Jun 5, 2020
@kurkle kurkle deleted the babel-loose branch June 12, 2020 05:35
etimberg pushed a commit that referenced this pull request Sep 1, 2020
* Use loose mode for babel
* Add note about loose mode in performance docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10x Performance Regression on uPlot Benchmark since v3.0.0-alpha
4 participants