String Reversal
JavaScript performance comparison
Info
Comparison of different string reversal methods
Preparation code
<script>
Benchmark.prototype.setup = function() {
var str = 'Bacon ipsum dolor sit amet pork belly venison fatback rump beef, speck shankle tenderloin beef ribs cow sirloin biltong kielbasa. Ground round speck filet mignon pancetta ball tip jowl. Chuck pastrami short ribs, filet mignon sirloin turkey shank pork belly cow drumstick. Capicola shankle meatball, ball tip bresaola short ribs meatloaf shank hamburger venison t-bone kielbasa sausage biltong tri-tip. Salami meatball beef fatback pork chop, venison ham prosciutto kielbasa. Brisket kielbasa drumstick strip steak short ribs tenderloin short loin. Venison rump tail, meatball jerky shankle hamburger drumstick sausage pancetta corned beef flank pork belly brisket pork loin.';
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
split, reverse, join |
|
pending… |
Iterate backwards |
|
pending… |
Iterate backwards, array |
|
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. Here’s a list of current revisions for this page:
- Revision 1: published by Paul Sayre
- Revision 2: published by bho
0 comments