-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const libc = require('..'); | ||
|
||
const now = performance.now(); | ||
const result = libc.familySync(); | ||
|
||
console.log(`[family] Time Spent ${performance.now() - now}ms`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const libc = require('..'); | ||
|
||
const now = performance.now(); | ||
const result = libc.isNonGlibcLinuxSync(); | ||
|
||
console.log(`[isNonGlibcLinux] Time Spent ${performance.now() - now}ms`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const libc = require('..'); | ||
|
||
const now = performance.now(); | ||
const result = libc.versionSync(); | ||
|
||
console.log(`[versionSync] Time Spent ${performance.now() - now}ms`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
const Benchmark = require('benchmark'); | ||
const suite = new Benchmark.Suite(); | ||
const libc = require('../'); | ||
|
||
suite.add('family', async function () { | ||
const result = await libc.family(); | ||
}); | ||
|
||
suite.add('familySync', function () { | ||
const result = libc.familySync(); | ||
}); | ||
|
||
suite.add('version', async function () { | ||
const result = await libc.version(); | ||
}); | ||
|
||
suite.add('versionSync', function () { | ||
const result = libc.versionSync(); | ||
}); | ||
|
||
suite.add('isNonGlibcLinux', async function () { | ||
const result = await libc.isNonGlibcLinux(); | ||
}); | ||
|
||
suite.add('isNonGlibcLinuxSync', function () { | ||
const result = libc.isNonGlibcLinuxSync(); | ||
}); | ||
|
||
suite | ||
// add listeners | ||
.on('cycle', function (event) { | ||
console.log(String(event.target)); | ||
}) | ||
.on('complete', function () { | ||
console.log('Fastest operation is ' + this.filter('fastest').map('name')); | ||
}) | ||
.run({ | ||
async: true | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters