Skip to main content

Yet Another Profiler But With Decorators

Project description

YAPBWD - Yet Another Profiler But With Decorators

This Profiler uses decorators, so it is easy to use:

  • Want to profile time of your program? No problem! Just add @YAPBWD.time_profiler

  • Want see how much memory your program uses? Here you are: add @YAPBWD.memory_profiler

  • This profiler also has clones of above decorators with many_ prefix. As it says, it runs the program many times and says the average time or memory.

Cannot understand? Here is a basic demonstration script for you!

import YAPBWD

@YAPBWD.time_profiler
def main(some_arguments):
    return some_arguments + 1

if __name__ == '__main__':
    main(2)

After execution, you can see the time it takes to Python to add one to a number.

Why you need it?

Well... I think time profiling is useful for everyone, but who will really know how much memory it requires doing something? I know that it is still useful for everybody who will write something like a math algorithm to test it is works fine and there are no problems.

P.S:

Don't try to use two decorators if you need to have accuracy measurements, because the result will be spoiled for a little.

Also, You shouldn't profile memory many times if you are having cache function like a lru_cache from functools.

Another thing, profiler decorators should be at the top of a decorators to work normally.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

YAPBWD-0.0.1.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

YAPBWD-0.0.1-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file YAPBWD-0.0.1.tar.gz.

File metadata

  • Download URL: YAPBWD-0.0.1.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.4.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.2

File hashes

Hashes for YAPBWD-0.0.1.tar.gz
Algorithm Hash digest
SHA256 2a2ccd893124cc79235ec59f395e59858aa2140b38fe20baf674557c414213c8
MD5 ddc1ef7f296cfdbc315032d91e453ff6
BLAKE2b-256 561c2fec46419e0db9e2d947df8e2994062d58c1089ecdc54da9564f87690814

See more details on using hashes here.

File details

Details for the file YAPBWD-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: YAPBWD-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.4.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.2

File hashes

Hashes for YAPBWD-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6cb1494ab28ec780534c0d52470a3e8a7baaa8b7cd92204b8dbfbfabeded8db0
MD5 9e796a7aef9dd369eefaf6c40cbc5629
BLAKE2b-256 b0af489d5b343fe57bd5d4826bc8bfe571dd83adfb9679ad14b6043635fe75e9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page