check for string and insert

JavaScript performance comparison

Test case created by noah edward hall

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
  var response = '?since_id=842751423255339009&q=%40realdonaldtrump&result_type=recent&include_entities=1';

};

Benchmark.prototype.teardown = function() {
  var response = '';

};
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
first
if(response.indexOf('count=') === -1) response = '?count=100&' + response.slice(1)
pending…
second
if(response.indexOf('count=') === -1) response = '?count=100&' + response.substring(1)
pending…

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

0 Comments