![]() Which appends metadata to a file on disk. This example also specifies the outfile option, To the constructor (in this case some_info=123) to specify additional Note that keyword arguments can be supplied Here's a more complete example using mixins (the MB prefixed class Microbench can capture many other types of metadataįrom the environment, resource usage, and hardware, The above example captures the fields start_time, finish_time andįunction_name. (using the pandas library): import pandas as pd results = pd. Into a io.StringIO() buffer, which can be read as follows That's it! When myfunction() is called, metadata will be captured To attach the benchmark to your function, simply use basic_bench as aĭecorator, like this: def myfunction ( arg1, arg2. Here's a minimal, complete example: from microbench import MicroBench basic_bench = MicroBench () ![]() Minimal exampleįirst, create a benchmark suite, which specifies the configuration and These examples willĪssume you have already defined a Python function myfunction that you wish toīenchmark: def myfunction ( arg1, arg2. Microbench is designed for benchmarking Python functions. To install using pip: pip install microbench Utility, which usually ships with the NVIDIA graphics card drivers. The CPU cores, total RAM, and telemetry extensions require.Standard library, but is usually available. MBInstalledPackages requires setuptools, which is not a part of the. ![]() Package needs to be installed for line-by-line code benchmarking. However, some mixins (extensions) have specific requirements: Library, although pandas is recommended toĮxamine results. Microbench by default has no dependencies outside of the Python standard Usage, environment variables, and hardware specifications. Other captured metadata can include CPU and RAM logging the versions of key Python packages, or even all packages loaded In addition to benchmarking, this can help reproducibility byĮ.g. It is most useful inĬlustered/distributed environments, where the same function runs under differentĮnvironments, and is designed to be extensible with newįunctionality. Optionally capturing extra runtime/environment information. Microbench is a small Python package for benchmarking Python functions, and
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |