String.prototype.contains vs. lodash contains (v2)

Revision 2 of this benchmark created on


Preparation HTML

<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.2.1/lodash.min.js"></script>
<script>String.prototype.nativeContains = String.prototype.contains; delete String.prototype.contains;</script>
<script src="https://rawgithub.com/mathiasbynens/String.prototype.contains/master/contains.js"></script>
<script>String.prototype.mthsContains = String.prototype.contains; delete String.prototype.contains;</script>
<script src="https://rawgithub.com/paulmillr/es6-shim/master/es6-shim.js"></script>
<script>String.prototype.paulsContains = String.prototype.contains</script>
<script src="https://gist.github.com/ChiperSoft/8027320/raw/0d93d7c33296bcddac6f3521a1a2d9143241e8aa/contains.js"></script>
<script>String.prototype.chipersContains = String.prototype.contains; delete String.prototype.contains;</script>

Test runner

Ready to run.

Testing in
TestOps/sec
es6-shim contains
'hello boring world'.paulsContains('boring')
ready
Mathias' contains
'hello boring world'.mthsContains('boring')
ready
native contains
'hello boring world'.nativeContains('boring')
ready
Lo-Dash contains (not 100% equivalent)
_.contains('hello boring world', 'boring')
ready
Chiper's Contains
'hello boring world'.chipersContains('boring')
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.