Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Javascript 'concat()' vs '+' for strings
Testing the performance difference between concat() and the + operator for strings in javascript
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:155.0) Gecko/20100101 Firefox/155.0
Browser:
Firefox 155
Operating system:
Linux
Device Platform:
Desktop
Date tested:
10 days ago
Benchmark engine:
Benchmark.js
plus_operator
751K/s
concat()
108K/s
View exact numbers
Test name
Executions per second
✓
plus_operator
750,662 Ops/sec
concat()
107,981 Ops/sec
Script Preparation code:
var string1 = "Hello "; var string2 = " world!";
Tests:
concat()
for(i = 0; i < 1000; i++) { string1.concat(string2); }
plus_operator
for(i = 0; i < 1000; i++) { string1 + string2; }