replaceAll vs str map for newline (v2)

Revision 2 of this benchmark created on


Setup

var currentValue = 'aasds\\nasdsad\\nasdsad\\nasdasdsa\\nasdasd\\nasdasd\\n'

Test runner

Ready to run.

Testing in
TestOps/sec
replaceAll
currentValue?.replaceAll('\\n','\n');
ready
str map
currentValue.split('\\n').map(str => str).join('\n')
ready
str split only
currentValue.split('\\n').join('\n')
ready

Revisions

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