
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
benchmark-framework
Advanced tools
A tiny framework for quick benchmarking with Benchmark.js.
Create an HTML doc for your perf tests like this:
<html>
<body>
<!-- Step 1: Include framework -->
<script src="benchmark-framework.min.js"></script>
<!-- Step 2 [optional]: Define setup code -->
<script type="benchmark-opt" name="setup">
console.log("Setting stuff up!");
</script>
<!-- Step 3 [optional]: Define teardown code -->
<script type="benchmark-opt" name="teardown">
console.log("I'm tearing stuff down!");
</script>
<!-- Step 4: Define test cases -->
<script type="benchmark-test" name="reverse loop">
var sum = 0;
var i = 1000;
while (i--) {
sum += i;
}
</script>
<script type="benchmark-test" name="forward loop">
var sum = 0;
var i = 0;
var limit = 1000;
while (i++ < limit) {
sum += i;
}
</script>
</body>
</html>
Open this document in any browser (or multiple browsers!) and observe the perf results in the console.
See also the example in test/test_perf.html
.
The benchmark-opt
and benchmark-event
script types accept any parameter that Benchmark.js can accept for options
and events
, respectively. For example, <script type="benchmark-event" name="abort">/* stuff */</script>
will compile that inner code and use it as the onAbort
event handler.
The event
scripts accept one parameter named event
. You can use this to customize how results are reported.
FAQs
Quick framework over Benchmark.js for when JSPerf is down
The npm package benchmark-framework receives a total of 2 weekly downloads. As such, benchmark-framework popularity was classified as not popular.
We found that benchmark-framework 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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.