Skip to content

green-code-initiative/creedengo-benchmark-javascript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JavaScript µBenchmarks

Microbenchmarks that (in)validate CreednGo rules.

This repository is a NPM project configured with the Mitata benchmarking framework.

Caution required

Rules often suggest an alternative way of writing small pieces of code. Measuring the effect of a small and isolated amount of code is hard, we need to be cautious. See Mitata doc - writing good benchmarks, and many others.

Required tools

To run or create benchmarks, you need NodeJS (or another compatible JS runtime).

Writing a new benchmark

  • Create a new mjs file in microbenchs.
  • Create some functions to test. Use mitata's bench to configure the benchmark, boxplot to get a graphical output, and run to execute the benchmark. See example.mjs.

Running one/multiple benchmark(s)

Use the bench.sh script, which is a wrapper around the JMH jar file. Run ./bench.sh -h too see the available JMH options.

To run a single benchmark file:

npm run benc -- path/to/file.mjs

Example:

npm run benc -- microbenchmarks/example.mjs

The benchmark results are printed to stdout. Please read mitata's README for more information about the benchmark tool.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

5 watching

Forks

Releases

No releases published

Sponsor this project

 

Packages

 
 
 

Contributors