How Much Performance Are Those Small Javascript Modules Costing You?

Adding more and more small Javascript modules might make things easier on the developer’s end, but it might also make things slower on the user’s end. Coder Nolan Lawson set out to test how much performance was lost when dealing with not only your own modules, but also dependencies.

Lawson wrote a tool to see how many modules were included in a package, as some of them can have more than expected. Then he looked at how many modules are in popular web applications (Reddit has a staggering 1,050), and benchmarked a module importing up to 5,000 other modules.

The TLDR version is as follows, but it’s worth reading the whole post.

So there you have it: one horse-sized JavaScript duck is faster than a hundred duck-sized JavaScript horses. Despite this fact, though, I hope that our community will eventually realize the pickle we’re in – advocating for a “small modules” philosophy that’s good for developers but bad for users – and improve our tools, so that we can have the best of both worlds.

[Nolan Lawson]

The Cheapest NBN 50 Plans

Here are the cheapest plans available for Australia’s most popular NBN speed tier.

At Lifehacker, we independently select and write about stuff we love and think you'll like too. We have affiliate and advertising partnerships, which means we may collect a share of sales or other compensation from the links on this page. BTW – prices are accurate and items in stock at the time of posting.


One response to “How Much Performance Are Those Small Javascript Modules Costing You?”