Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
me vs chatgpt
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Me
707017.1 Ops/sec
Chatgpt
221905.9 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
/*your preparation JavaScript code goes here To execute async code during the script preparation, wrap it as function globalMeasureThatScriptPrepareFunction, example:*/ async function globalMeasureThatScriptPrepareFunction() { // This function is optional, feel free to remove it. // await someThing(); }
Tests:
Me
const arr = [8, 9, 3, 9, 6, 5, 1, 7, 3, 9, 4, 1, 7, 2, 8, 3, 2, 1, 4, 7]; const small5 = [arr[0]]; const big5 = [arr[0]]; for (const n of arr.slice(1)) { if (n < small5[4] || small5.length < 5) { for (let i = 0; i < 5; ++i) { if (n < small5[i] || i === small5.length - 1) { small5.splice(i, 0, n); break; } } } if (n > big5[4] || big5.length < 5) { for (let i = 0; i < 5; ++i) { if (n > big5[i]) { big5.splice(i, 0, n); break; } else if (i === big5.length - 1) { big5.push(n); break; } } } } let total = 0; for (let i = 0; i < 5; ++i) { total += small5[i] + big5[i]; }
Chatgpt
const arr = [8, 9, 3, 9, 6, 5, 1, 7, 3, 9, 4, 1, 7, 2, 8, 3, 2, 1, 4, 7]; const small5 = []; const big5 = []; for (const n of arr) { // Maintain 5 smallest numbers if (small5.length < 5 || n < small5[4]) { small5.push(n); small5.sort((a, b) => a - b); // Ensure the smallest numbers are sorted if (small5.length > 5) small5.pop(); // Keep only the smallest 5 } // Maintain 5 largest numbers if (big5.length < 5 || n > big5[4]) { big5.push(n); big5.sort((a, b) => b - a); // Ensure the largest numbers are sorted if (big5.length > 5) big5.pop(); // Keep only the largest 5 } } // Calculate the total sum const total = small5.reduce((sum, num) => sum + num, 0) + big5.reduce((sum, num) => sum + num, 0);