Slice vs Substr vs Substring vs [ ] Methods

JavaScript performance comparison

Revision 56 of this test case created by Bernard Poulin

Preparation code

An outstanding share! I've just forwarded this onto a co-worker who has 
been conducting a little homework on this. And he in fact bought me lunch because I stumbled upon it for him...

lol. So let me reword this.... Thanks for 
the meal!! But yeah, thanx for spending some time to discuss 
this subject here on your web page.
      
<script>
Benchmark.prototype.setup = function() {
  An outstanding share! I've just forwarded this onto a co-worker who has been conducting a little homework on this.
  
  And he in fact bought me lunch because I stumbled upon it for 
  him... lol. So let me reword this.... Thanks for the meal!!
  But yeah, thanx for spending some time to discuss this subject here on your web page.

};

Benchmark.prototype.teardown = function() {
  An outstanding share! I've just forwarded this onto a co-worker who has been conducting a little homework on this.
  And he in fact bought me lunch because I stumbled upon it for him...
  lol. So let me reword this.... Thanks for the meal!!
  But yeah, thanx for spending some time to discuss this subject here on your 
  web page.

};
</script>

Preparation code output

An outstanding share! I've just forwarded this onto a co-worker who has been conducting a little homework on this. And he in fact bought me lunch because I stumbled upon it for him... lol. So let me reword this.... Thanks for the meal!! But yeah, thanx for spending some time to discuss this subject here on your web page.

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)
An outstanding share! I've just forwarded this onto a co-worker 
who has been conducting a little homework on this.
And he in fact bought me lunch because I stumbled upon it for him...

lol. So let me reword this.... Thanks for the meal!!
But yeah, thanx for spending some time to discuss this subject here 
on your web page.
pending…
Slice (long)
An outstanding share! I've just forwarded this onto a co-worker who has been conducting a little homework on this.
And he in fact bought me lunch because I stumbled upon it for him...

lol. So let me reword this.... Thanks for the meal!!
But yeah, thanx for spending some time to discuss this subject 
here on your web page.
pending…
Substr (long)
An outstanding share! I've just forwarded this onto a co-worker who has been conducting a little homework on this.
And he in fact bought me lunch because I stumbled upon it for him...
lol. So let me reword this.... Thanks for the meal!!
But yeah, thanx for spending some time to discuss this subject here on your web page.
pending…
[ ] (long)
An outstanding share! I've just forwarded this onto a co-worker who has been conducting a little homework on this.
And he in fact bought me lunch because I stumbled upon it 
for him... lol. So let me reword this.... Thanks for the 
meal!! But yeah, thanx for spending some time to discuss this subject here on your web page.
pending…
charAt (long)
An outstanding share! I've just forwarded this onto a co-worker who has been conducting a 
little homework on this. And he in fact bought me lunch 
because I stumbled upon it for him... lol. So let me reword this....
Thanks for the meal!! But yeah, thanx for spending some time to discuss this subject here 
on your web page.
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

An outstanding share! I've just forwarded this onto a co-worker who has been conducting a little homework on this. And he in fact bought me lunch because I stumbled upon it for him... lol. So let me reword this.... Thanks for the meal!! But yeah, thanx for spending some time to discuss this subject here on your web page.