testdouble / teenytest

A very simple, zero-config test runner for Node.js
MIT License
96 stars 14 forks source link

require individual lodash functions #21

Closed jasonkarns closed 7 years ago

jasonkarns commented 8 years ago

Whole-lodash requires removed from index, lib/, and plugins/. Not intending to remove from example/ or test/ unless either of those would be within the code-path of the profiler.

This should be good to go for profiling to see if it's worth avoiding the "whole-lodash" tax. There is plenty of room for improvement by switching to the native variants where it makes sense. (Most notably, _assign, _map, _each, and _filter; of course only in the cases not using lodash shorthand) I'm assuming teentytest sets ES5 as a baseline of support so these are all safe.

searls commented 8 years ago

Dude, awesome! Was not expecting this.

I have one idea, which is to add a benchmarks directory to master and verify this speeds it up before merge. Would be nice to get that in the build to fail when we have perf regressions.

Thoughts?

jasonkarns commented 8 years ago

Yeah, definitely don't want to bother merging until perf improvement is proven. (Since I'm still a bit skeptical.)

mweitzel commented 8 years ago

I profiled this on my machine and as it stands it actually adds about 40ms.

searls commented 8 years ago

welp

mweitzel commented 8 years ago

pr for discussion is up with refactor to lodash/core #22