Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
reverse words v4
(version: 0)
Comparing performance of:
Partial chaining vs Full chaining vs Regex vs No chain
Created:
4 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var str = "This is an example!";
Tests:
Partial chaining
var reversed = str.split(' ').map( str => str.split('').reverse().join('') ).join(' ');
Full chaining
var reversed = str.split("").reverse().join("").split(" ").reverse().join(" ");
Regex
str.replace(/\S+/g, w => w.split('').reverse().join(''));
No chain
str = str.split("") str = str.reverse() str = str.join("") str = str.split(" ") str = str.reverse() str = str.join(" ");
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
Partial chaining
Full chaining
Regex
No chain
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
reverse words
reverse words v3
test-moh1
Testing replaceAll vs splitting a string to perform some operations
Comments
Confirm delete:
Do you really want to delete benchmark?