Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

comfy-bench

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

comfy-bench

Easy benchmarking

  • 0.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

comfy-bench

NPM version

Easy benchmarking

Features:

  • Very easy to use
  • Gives pretty accurate numbers
  • Hit ctl-c to interrupt and get quick results
  • Works with very fast and very slow operations
  • Works with sync and async operations

Example: readfile.js

import * as bench from 'comfy-bench'
import fsprom from 'fs/promises'

bench.add('read /etc/hostname', () => {
  return fsprom.readFile('/etc/hostname')
})

bench.run()

output:

╔════════════════════╤═════════╤═══════╤═════════╗
║ Operation          │ ops/sec │ Range │ usec/op ║
╟────────────────────┼─────────┼───────┼─────────╢
║ read /etc/hostname │  17,506 │   ±2% │ 57      ║
╚════════════════════╧═════════╧═══════╧═════════╝

Example: system.js

import * as bench from 'comfy-bench'

bench.addSystemBenchmarks()

bench.run()

output:

Discarding best and worst samples, since we have 5 or more
╔════════════════════════════════════╤════════════╤═══════╤═════════╗
║ Operation                          │    ops/sec │ Range │ usec/op ║
╟────────────────────────────────────┼────────────┼───────┼─────────╢
║ function call                      │ 71,710,658 │   ±4% │ 0       ║
║ async function call                │  9,908,368 │   ±1% │ 0       ║
║ Date.now()                         │ 14,884,354 │   ±1% │ 0       ║
║ readdir /etc                       │      4,053 │   ±1% │ 247     ║
║ read /etc/hostname                 │     16,755 │   ±1% │ 60      ║
║ read 1 bytes from /etc/hostname    │     72,555 │   ±2% │ 14      ║
║ read 1024 bytes from /etc/hostname │     73,665 │   ±1% │ 14      ║
║ read 16 bytes from /dev/urandom    │     65,780 │   ±2% │ 15      ║
║ read 8192 bytes from /dev/urandom  │      5,341 │   ±7% │ 187     ║
║ read 16 bytes from /dev/zero       │     75,093 │   ±1% │ 13      ║
║ read 8192 bytes from /dev/zero     │     70,731 │   ±1% │ 14      ║
╚════════════════════════════════════╧════════════╧═══════╧═════════╝

Keywords

FAQs

Package last updated on 04 Jun 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc