esamattis / esamattis/underscore.string
Optimize _.pad
Open
- Dominant language
- JavaScript
- Stars
- 3.4k
- Forks
- 367
- PR merge metrics
- No merged PRs in 30d
Description
I've made a test perf for _.pad for the case of zero padding with numbers.
http://jsperf.com/ways-to-0-pad-a-number/15
As you can see, Underscore.string is usually half as slow than the medium.
I think we can optimize this a bit more by using Math for the case of numbers.
Contributor guide
Assessment
This issue has not been assessed yet.