Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
reverse string test
(version: 1)
Comparing performance of:
backwards reduce vs array.from
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
function* backwards(iterable) { for (let { length } = iterable; length--;) yield iterable[length] } function reducer(a,b) { return a+b } let string = '1234567890'.repeat(60)
Tests:
backwards reduce
for(let i = 300; i--;)var abc = backwards(string).reduce(reducer)
array.from
for(let i = 300; i--;)var abc = Array.from(string).toReversed().join('')
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
backwards reduce
array.from
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Browser/OS:
Chrome 126 on Chrome OS 14541.0.0
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
backwards reduce
104.6 Ops/sec
array.from
181.0 Ops/sec
Related benchmarks:
reverse string2
reduce vs map & join
testing for and recursion
reduce vs for custom
reduce vs for custom_222
for vs reverse
String reversal
String reversal 2
String reversal 3
Comments
Confirm delete:
Do you really want to delete benchmark?