underscore icon indicating copy to clipboard operation
underscore copied to clipboard

Go on a Diet

Open jashkenas opened this issue 10 years ago • 8 comments

Underscore is getting a little chunky around the edges...

We're up to 5.8k, minified and gzipped. It would be lovely to get that back down under 5...

jashkenas avatar Feb 19 '15 22:02 jashkenas

Theres better ways to do this than deleting methods. omit and pick, max and min and several others are nearly duplicates of each other. It would not be hard to generate those functions

megawac avatar Feb 20 '15 00:02 megawac

~~Maybe if we dropped support for older browsers we could cut down on the size..~~

Oh didn't see this one:

  • [x] https://github.com/jashkenas/underscore/issues/2062 Drop support for older browsers

paulfalgout avatar Feb 20 '15 01:02 paulfalgout

I'd be happy to spend a few hours looking for places to trim down (I'm sure others would too). However, no one was given the opportunity.

I know what the answer is going to be to this, but please mark 1.7 as latest on npm and revert 1.8 before people start using it.

jamiebuilds avatar Feb 20 '15 01:02 jamiebuilds

Also ping https://github.com/jashkenas/underscore/issues/1594

megawac avatar Mar 21 '15 23:03 megawac

Could we look for some features in underscore that could be moved to underscore-contrib?

jmdevivo avatar May 27 '15 17:05 jmdevivo

FYI Underscore is now 6kb gzipped, which is up from 5.8kb for v1.8.3 (site says 5.7kb).

jdalton avatar Aug 04 '15 19:08 jdalton

Im sure there is an excellent reason for this, and id love to hear it but wouldn't it save quite a bit of size if Underscore used more of its own functions internally? such as _.each, _.filter, _.map ect...

At quick glance it seems there a quite a few more places that Underscore could "Dog Food" itself.

One of the things I love about Underscore is how it decreases the amount of Javascript I write in my projects. Seems Underscore itself could take more advantage of that.

dperrymorrow avatar Dec 01 '15 00:12 dperrymorrow

@dperrymorrow

Im sure there is an excellent reason for this, and id love to hear it but wouldn't it save quite a bit of size if Underscore used more of its own functions internally? such as _.each, _.filter, _.map ect...

My guess is it's a concern over performance. That said I'm sure there are plenty of methods where performance isn't a concern for their common usage scenarios. It would be worth reviewing areas where dog fooding can be improved, nixing those areas where perf flags are raised.

jdalton avatar Dec 01 '15 01:12 jdalton