
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
benchmartian
Advanced tools
Benchmartian allows you to run your incredible [benchmark.js][http://benchmarkjs.com] benchmarks from the command line much like you would any other test suite such as mocha
.
Install from npm.
$ npm install -g benchmartian
And to run benchmarks:
$ benchmartian
Benchmarking benchmarks/benchmarks.js..
..
Completed file benchmarks/benchmarks.js.
Results
-> benchmarks/benchmarks.js
RegExp#test x 15,634,369 ops/sec ±0.96% (94 runs sampled)
String#indexOf x 25,131,771 ops/sec ±0.97% (95 runs sampled)
Simple as.
Benchmartian will take an array of files as arguments or if no arguments are given, benchmartian
will look in benchmark/
directory of current working directory. You can also supply a reporter which will define how the test results are outputted. To see a list of reporters do benchmartian --reporters
.
benchmartian -- Run benchmark.js benchmarks from the CLI.
Usage:
benchmartian [files] Begin benchmarking. If no are files supplied, benchmartian looks in `benchmark/`.
--reporter [reported] Select a reporter from /reporters. Defaults to basic.
--reporters Print out available reporters.
--help Print this help.
To make defining benchmarks incredibly simple, benchmartian
exposes all methods on the benchmark.Suite
prototype into the global scope which allows for concise definitions. The only function benchmartian
calls (if it hasn't already been called with your own options) is suite.run
. The reporters take care of handling the output so you can sit back and focus on your benchmarks.
Example from the benchmarkjs.com homepage.
add('RegExp#test', function() {
/o/.test('Hello World!');
});
add('String#indexOf', function() {
'Hello World!'.indexOf('o') > -1;
});
Example defining your own run
options:
add('RegExp#test', function() {
/o/.test('Hello World!');
});
add('String#indexOf', function() {
'Hello World!'.indexOf('o') > -1;
});
options.maxTime = 3; // Second
Since benchmark.Suite
is exposed, you can configure how the benchmarks are run by supplying options to the run
function or set them on the global options
variable. For the options documentation, see here.
Reporters for benchmartian
are made incredibly easy by the benchmark.js
library. To begin, create a Javascript file by the name of your reporter in the reporters/
directory and require the index.js
file. See reporter/basic.js
for an example.
var reporter = require("./");
The reporter's job is to handle different events emitted by benchmartian
and a benchmark.Suite
on a suite. benchmartian
emits 3 events:
begin
with the (files)
as an argument.file
with (filename, suite)
. It's in this callback where you define your benchmark.Suite
events.complete
with (results)
. Results is a key value store of filename: suite
so you can compile a comphrensive report.Finally, export your reporter:
module.exports = reporter;
Thanks to the authors of the incredible benchmark.js library. benchmartian
owes it's existance to it.
MIT
FAQs
Benchmark.js mocha like command line interface
We found that benchmartian demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.