jQuery Trim 1.4.2 vs 1.4.3

Benchmark created by Shay Erlichmen on


Preparation HTML

<script>
  var rtrim = /^(\s|\u00A0)+|(\s|\u00A0)+$/g
  var trim142 = function(text) {
   return (text || "").replace(rtrim, "");
  }
  var trim143 = String.prototype.trim;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery 1.4.2 trim
trim142("      hello world          ")
ready
jQuery 1.4.3 trim
trim143("      hello world          ")
ready

Revisions

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

  • Revision 1: published by Shay Erlichmen on