Optimize _.unescape.

This commit is contained in:
John-David Dalton
2013-12-06 09:13:38 -08:00
parent 9a0465eb05
commit 3633d3cd73
9 changed files with 65 additions and 15 deletions

View File

@@ -885,12 +885,12 @@
Benchmark.Suite('`_.every` iterating an array')
.add(buildName, '\
lodash.every(numbers, function(num) {\
return num + "";\
return num;\
})'
)
.add(otherName, '\
_.every(numbers, function(num) {\
return num + "";\
return num;\
})'
)
);
@@ -899,12 +899,12 @@
Benchmark.Suite('`_.every` iterating an object')
.add(buildName, '\
lodash.every(object, function(num) {\
return num + "";\
return num;\
})'
)
.add(otherName, '\
_.every(object, function(num) {\
return num + "";\
return num;\
})'
)
);
@@ -1844,6 +1844,28 @@
/*--------------------------------------------------------------------------*/
suites.push(
Benchmark.Suite('`_.unescape` string without html entities')
.add(buildName, '\
lodash.unescape("`&`, `<`, `>`, `\\"`, and `\'`")'
)
.add(otherName, '\
_.unescape("`&`, `<`, `>`, `\\"`, and `\'`")'
)
);
suites.push(
Benchmark.Suite('`_.unescape` string with html entities')
.add(buildName, '\
lodash.unescape("`&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;`")'
)
.add(otherName, '\
_.unescape("`&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;`")'
)
);
/*--------------------------------------------------------------------------*/
suites.push(
Benchmark.Suite('`_.union`')
.add(buildName, '\