Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
string interpolation vs direct access
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Browser:
Chrome 126
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
string interpolation
605898.3 Ops/sec
direct access
1022428.2 Ops/sec
Script Preparation code:
var objectString = { "reportActions_1234": { action: "view", timestamp: "2024-07-17T10:15:30Z", user: "JohnDoe" }, "reportActions_5678": { action: "edit", timestamp: "2024-07-17T11:20:45Z", user: "JaneSmith" }, "reportActions_91011": { action: "delete", timestamp: "2024-07-17T12:25:50Z", user: "AlexJohnson" }, "reportActions_1213": { action: "create", timestamp: "2024-07-17T13:30:55Z", user: "EmilyBrown" }, "reportActions_1415": { action: "share", timestamp: "2024-07-17T14:35:00Z", user: "ChrisDavis" }, "reportActions_1235": { action: "view", timestamp: "2024-07-17T10:15:30Z", user: "JohnDoe" }, "reportActions_5679": { action: "edit", timestamp: "2024-07-17T11:20:45Z", user: "JaneSmith" }, "reportActions_91021": { action: "delete", timestamp: "2024-07-17T12:25:50Z", user: "AlexJohnson" }, "reportActions_1214": { action: "create", timestamp: "2024-07-17T13:30:55Z", user: "EmilyBrown" }, "reportActions_1416": { action: "share", timestamp: "2024-07-17T14:35:00Z", user: "ChrisDavis" }, "report_1234": { action: "view", timestamp: "2024-07-17T10:15:30Z", user: "JohnDoe" }, "report_5678": { action: "edit", timestamp: "2024-07-17T11:20:45Z", user: "JaneSmith" }, "report_91011": { action: "delete", timestamp: "2024-07-17T12:25:50Z", user: "AlexJohnson" }, "report_1213": { action: "create", timestamp: "2024-07-17T13:30:55Z", user: "EmilyBrown" }, "report_1415": { action: "share", timestamp: "2024-07-17T14:35:00Z", user: "ChrisDavis" }, "report_1235": { action: "view", timestamp: "2024-07-17T10:15:30Z", user: "JohnDoe" }, "report_5679": { action: "edit", timestamp: "2024-07-17T11:20:45Z", user: "JaneSmith" }, "report_91021": { action: "delete", timestamp: "2024-07-17T12:25:50Z", user: "AlexJohnson" }, "report_1214": { action: "create", timestamp: "2024-07-17T13:30:55Z", user: "EmilyBrown" }, "report_1416": { action: "share", timestamp: "2024-07-17T14:35:00Z", user: "ChrisDavis" } }; var objectStandar = { "reportActions_": { "123": { "name": "Action 1", "description": "Description for action 1", "completed": true }, "234": { "name": "Action 2", "description": "Description for action 2", "completed": false }, "1232": { "name": "Action 1", "description": "Description for action 1", "completed": true }, "2343": { "name": "Action 2", "description": "Description for action 2", "completed": false }, "1234": { "name": "Action 1", "description": "Description for action 1", "completed": true }, "2345": { "name": "Action 2", "description": "Description for action 2", "completed": false }, "1236": { "name": "Action 1", "description": "Description for action 1", "completed": true }, "2347": { "name": "Action 2", "description": "Description for action 2", "completed": false }, "1238": { "name": "Action 1", "description": "Description for action 1", "completed": true }, "2349": { "name": "Action 2", "description": "Description for action 2", "completed": false } }, "reports_": { "3331": { "title": "Report 1", "summary": "Summary of report 1", "approved": true }, "4442": { "title": "Report 2", "summary": "Summary of report 2", "approved": false }, "3333": { "title": "Report 1", "summary": "Summary of report 1", "approved": true }, "4444": { "title": "Report 2", "summary": "Summary of report 2", "approved": false }, "3335": { "title": "Report 1", "summary": "Summary of report 1", "approved": true }, "444": { "title": "Report 2", "summary": "Summary of report 2", "approved": false }, "3336": { "title": "Report 1", "summary": "Summary of report 1", "approved": true }, "4447": { "title": "Report 2", "summary": "Summary of report 2", "approved": false }, "3338": { "title": "Report 1", "summary": "Summary of report 1", "approved": true }, "4449": { "title": "Report 2", "summary": "Summary of report 2", "approved": false } } };
Tests:
string interpolation
const reportActionIds = [ "1234", "5678", "91011", "1213", "1415", "1235", "5679", "91021", "1214", "1416" ]; const reportIds = [ "1234", "5678", "91011", "1213", "1415", "1235", "5679", "91021", "1214", "1416" ]; for (let i of reportActionIds) { objectString[`reportActions_${i}`]; } for (let i of reportIds) { objectString[`report_${i}`]; }
direct access
const reportActionIds = [ "123", "234", "1232", "2343", "1234", "2345", "1236", "2347", "1238", "2349" ]; const reportIds = [ "3331", "4442", "3333", "4444", "3335", "444", "3336", "4447", "3338", "4449" ]; for (let i of reportActionIds) { objectStandar["reportActions_"][i]; } for (let i of reportIds) { objectStandar["reports_"][i]; }