Polyfills might slow down code

Babel should have no effect on performance, however

Dr. Derek Austin 🥳
1 min readSep 22, 2019

--

Photo by Erwan Hesry on Unsplash

Thanks for stopping by John Au-Yeung !!! I always really enjoy your programming articles, so thank you for your response to mine.

Theoretically, there are cases where polyfills will slow down the code significantly, especially if one were to test how well those polyfills actually run in something like IE9.

I found one such case, where the padStart() function from the ES2018 specification is over 8x faster than its polyfill:

Transpiling should not make any difference

As far as Babel is concerned, translating syntactic sugar from currently-allowed syntax to the older format should be just as fast.

Polyfills only suffer performance hits because they are entirely new features that have been added to JavaScript — not just syntax changes.

I agree with you that it is amazing how far JavaScript has come — it is a much easier to learn and usable language than a decade ago.

Thanks to all those who have submitted ECMAScript proposals and written cool JavaScript frameworks & associated tools!

--

--

Dr. Derek Austin 🥳

I love working with Next.js + Tailwind CSS ♦ Lead UI / UX Product Engineer ♦ React Software Architect ♦ SEO & Web Performance Expert ♦ I love accessibility 🥰