GithubHelp home page GithubHelp logo

Comments (11)

sodatea avatar sodatea commented on July 23, 2024

支持 loose mode 的 transformer 也没几个……如果仔细看过文档的话,避开这些坑也不难。

不过根据 Six Speed,loose mode 下有显著性能差异的 ES6 特性只有 for-of-array、super 和 tagged template string 这几个。
所以我觉得更好的做法是,等 babel 6 稳定下来后,单独针对某个 transformer 配置 loose mode。

from spec.

hax avatar hax commented on July 23, 2024

“仔细看过文档”是一个不太靠谱的假设啊~

from spec.

otakustay avatar otakustay commented on July 23, 2024

这条是在babel还是5的时代下出来的,在babel6的情况下我们针对对应的transformer在性能出现问题时配就好了

from spec.

hax avatar hax commented on July 23, 2024

我的意思是你的应用没有benchmark证明某一点是性能瓶颈,则没有必要做这样的事情。

from spec.

errorrik avatar errorrik commented on July 23, 2024

@otakustay 我记得貌似内部讨论时说的是代码体积的问题而不是性能?

from spec.

otakustay avatar otakustay commented on July 23, 2024

是的,和代码体积有关,主要是defineProperty代替prototype.xxx以及for .. of的转换

from spec.

hax avatar hax commented on July 23, 2024

代码体积在gzip压缩之后应该并没有什么大差异吧

from spec.

errorrik avatar errorrik commented on July 23, 2024

@leeight 在项目里试试?

from spec.

otakustay avatar otakustay commented on July 23, 2024

我拿了2个项目试一下,基本gzip后差异在2.5%左右

不过确实我们没有大量使用for .. of这些东西,能mapforEach之类的就用上了

这种差异我认为是可以忽略的

from spec.

errorrik avatar errorrik commented on July 23, 2024

ok,并且loose在babel6里面已经不是个东西了。虽然6现在还坑不少,但是可预见很快会逐步填上。我觉得这条可以去掉, @otakustay 你觉得呢?

from spec.

otakustay avatar otakustay commented on July 23, 2024

这条就去掉吧

from spec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.