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

fastbench

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastbench

A pure-python based benchmarking package for Python 🤪

  • 0.1.5
  • PyPI
  • Socket score

Maintainers
1



FastBench
PyPI - Downloads GitHub repo size

FastBench is a high-performance Python package for benchmarking code execution time, CPU usage, and memory usage. It's implemented in Python for simplicity and provides a simple API for measuring the performance of your Python code.

✨ Features

  • ⏱️ Measure the execution time of a function or code block
  • 📊 Track CPU usage during code execution
  • 🖥️ Monitor memory usage during code execution
  • ⚡ Lightweight and fast
  • 🔄 Simple and easy-to-use API

Installation

You can install FastBench via pip:

pip install fastbench

Usage

Here's an example of how to use FastBench to benchmark Python code:

from fastbench import mt, mc, mm

# Define a sample function for testing
def sample_function(n):
  return sum(range(n))

# Test the mt function (measure execution time)
time_taken = mt(sample_function, n=1000000)
print("Time taken:", time_taken)

# Test the mc function (measure CPU usage)
cpu_usage = mc(sample_function, n=1000000)
print("CPU usage:", cpu_usage)

# Test the mm function (measure memory usage)
memory_usage = mm(sample_function, n=1000000)
print("Memory usage:", memory_usage)

Contributing

Contributions are welcome! Check out the Contribution Guidelines.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Keywords

FAQs


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