Slice vs Substr vs Substring vs [ ] Methods

JavaScript performance comparison

Revision 62 of this test case created by Jillian

Preparation code

Hello There. I discovered your blog the use of msn. This 
is an extremely well written article. I will be sure 
to bookmark it and come back to read extra of your useful info.
Thank you for the post. I will certainly return.
      
<script>
Benchmark.prototype.setup = function() {
  Hello There. I discovered your blog the use of msn. This is 
  an extremely well written article. I will be sure to 
  bookmark it and come back to read extra of your useful 
  info. Thank you for the post. I will certainly return.

};

Benchmark.prototype.teardown = function() {
  Hello There. I discovered your blog the use of msn. This is 
  an extremely well written article. I will be sure to bookmark it and 
  come back to read extra of your useful info. Thank you for the post.
  I will certainly return.

};
</script>

Preparation code output

Hello There. I discovered your blog the use of msn. This is an extremely well written article. I will be sure to bookmark it and come back to read extra of your useful info. Thank you for the post. I will certainly return.

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
Substring (long)
Hello There. I discovered your blog the use of msn. This is an extremely well written article.

I will be sure to bookmark it and come back to read extra of your useful info.
Thank you for the post. I will certainly return.
pending…
Slice (long)
Hello There. I discovered your blog the use of msn. This is an extremely 
well written article. I will be sure to bookmark it and come back 
to read extra of your useful info. Thank you for the post.
I will certainly return.
pending…
Substr (long)
Hello There. I discovered your blog the use of msn. This is an extremely well written article.
I will be sure to bookmark it and come back to read extra of your useful info.
Thank you for the post. I will certainly return.
pending…
[ ] (long)
Hello There. I discovered your blog the use of msn. 
This is an extremely well written article. I will be sure to 
bookmark it and come back to read extra of your useful info.
Thank you for the post. I will certainly return.
pending…
charAt (long)
Hello There. I discovered your blog the 
use of msn. This is an extremely well written article.
I will be sure to bookmark it and come back to read extra of 
your useful info. Thank you for the post. I will certainly return.
pending…

Compare results of other browsers

Revisions

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

0 Comments

Hello There. I discovered your blog the use of msn. This is an extremely well written article. I will be sure to bookmark it and come back to read extra of your useful info. Thank you for the post. I will certainly return.