Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion benchmark/os/uptime.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
'use strict';

const os = require('os');
const common = require('../common.js');
const uptime = require('os').uptime;
const assert = require('assert');

const uptime = os.uptime;

const bench = common.createBenchmark(main, {
n: [1e5],
});

function main({ n }) {
if (os.type() === 'OS400') {
console.log('Skipping: os.uptime is not implemented on IBMi');
process.exit(0);
}
Comment on lines +14 to +17
Copy link
Copy Markdown
Member

@H4ad H4ad Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is better to put outside main, on top of the file, just not to have any weird behavior.

But is not a blocker for me, so do it if you agree.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mhdawson can you move this to a similar position like in other fs benchmarks?


// Warm up.
const length = 1024;
const array = [];
Expand Down
9 changes: 0 additions & 9 deletions benchmark/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
const path = require('path');
const fork = require('child_process').fork;
const CLI = require('./_cli.js');
const os = require('os');

const cli = new CLI(`usage: ./node run.js [options] [--] <category> ...
Run each benchmark in the <category> directory a single time, more than one
Expand All @@ -21,14 +20,6 @@ const cli = new CLI(`usage: ./node run.js [options] [--] <category> ...
`, { arrayArgs: ['set', 'filter', 'exclude'] });
const benchmarks = cli.benchmarks();

// IBMi does not have working uptime so don't try to run
// that benchmark
if (os.type() === 'OS400') {
const index = benchmarks.indexOf('os/uptime.js');
if (index !== -1)
benchmarks.splice(index, 1);
}

if (benchmarks.length === 0) {
console.error('No benchmarks found');
process.exitCode = 1;
Expand Down