Script Preparation code:
AخA
 
const counter = { val: 0 };
function action() {
  counter.val++;
}
function actionWithLog() {
  counter.val++;
  console.log('ok');
}
function actionWithLogData() {
  counter.val++;
  console.log('ok', counter);
}
const customLog = [];
function actionWithCustomLog() {
  counter.val++;
  customLog.push(['ok', {...counter}]);
}
Tests:
  • action

     
    action();
  • actionWithLog

     
    actionWithLog();
  • actionWithLogData

     
    actionWithLogData();
  • actionWithCustomLog

     
    actionWithCustomLog()
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    action
    actionWithLog
    actionWithLogData
    actionWithCustomLog

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 9 months ago)
Mozilla/5.0 (X11; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0
Firefox 124 on Linux
View result in a separate tab
Test name Executions per second
action 686780352.0 Ops/sec
actionWithLog 65731.2 Ops/sec
actionWithLogData 56033.8 Ops/sec
actionWithCustomLog 5026856.5 Ops/sec