Giter Site home page Giter Site logo

drkostas / bench-utils Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 42 KB

A collection of benchmarking tools.

Home Page: https://pypi.org/project/bench-utils/

License: Apache License 2.0

Makefile 18.07% Python 81.93%
benchmark timit benchmarking timer

bench-utils's Introduction

Benchmark Utilities

Downloads GitHub license

About

A collection of benchmarking tools. PYPI Package

Table of Contents

Using the library

Installing and using the library

First, you need to install the library either using pip:

$ pip install bench_utils

Then, import it and use it like so:

from bench_utils import timeit, profileit

# --- Timeit --- #
# Context Manager
with timeit():
    # A code block
    pass


@timeit()
def my_func():
    # Function code
    pass


# --- Profileit --- #
# Context Manager
with profileit():
    # A code block
    pass


@profileit()
def my_func():
    # Function code
    pass

For more advanced examples check example_timeit.py and example_profileit.py .

Manually install the library

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

You need to have a machine with anaconda installed and any Bash based shell (e.g. zsh) installed.

$ conda -V
conda 4.10.1

$ echo $SHELL
/usr/bin/zsh

Install the requirements

All the installation steps are being handled by the Makefile.

First, modify the python version (min_python) and everything else you need in the settings.ini.

Then, execute the following commands:

$ make create_env
$ conda activate bench_utils
$ make dist

Now you are ready to use and modify the library.

Update PyPI package

This is mainly for future reference for the developers of this project. First, create a file called ~/.pypirc with your pypi login details, as follows:

[pypi]
username = your_pypi_username
password = your_pypi_password

Then, modify the python version (min_python), project status (status), release version (version) and everything else you need in the settings.ini.

Finally, execute the following commands:

$ make create_env
$ conda activate bench_utils
$ make release

For a dev release, change the testing_version and instead of make release, run make release_test.

License

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

Buy Me A Coffee

bench-utils's People

Contributors

drkostas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.