Module with C functions. No precise purpose yet.
Project description
cpyquickhelper: python + C++ in different ways
cpyquickhelper is a template to create a module with C functions in different ways. It implements function measure_time:
from cpyquickhelper.numbers import measure_time from math import cos res = measure_time(lambda: cos(0.5)) print(res)
{'average': 3.909366205334663e-06, 'deviation': 6.238702219064397e-07, 'min_exec': 3.635883331298828e-06, 'max_exec': 5.776062607765198e-06, 'repeat': 10, 'number': 50, 'context_size': 240}
It also implements an event profiler: it logs the timestamp for every event such as functions call or returns, memory allocations.
import io import numpy from cpyquickhelper.profiling import EventProfiler def custom_array(N): a = numpy.zeros((N, N)) a[:, 0] = 1 a[0, :] = 1 return a ev = EventProfiler(impl='c') ev.start() custom_array(3) ev.stop() df = ev.retrieve_results() # DataFrame st = io.StringIO() df.to_csv(st, index=False) print(st.getvalue().replace("\r", ""))
time,value1,value2,event,name,mod,lineno,from_name,from_mod,from_line 822467345556400,0,0,return,_setup_profiler,cpyquickhelper/profiling/event_profiler.py,153,start,cpyquickhelper/profiling/event_profiler.py,126 822467345566700,0,0,c_call,_profiling_register_pyinstance,cpyquickhelper.profiling._event_profiler_c,109,_profiling_register_pyinstance,k.py,19 822467345569000,0,0,c_return,_profiling_register_pyinstance,cpyquickhelper.profiling._event_profiler_c,109,_profiling_register_pyinstance,k.py,19 822467345569700,0,0,return,start,cpyquickhelper/profiling/event_profiler.py,109,<module>,k.py,19 822467345575100,0,0,call,custom_array,k.py,5,<module>,k.py,19 822467345579600,0,0,c_call,zeros,numpy,5,zeros,k.py,19 822467345584300,2698130437280,32,malloc,start,cpyquickhelper/profiling/event_profiler.py,109,<module>,k.py,19 822467345590500,0,0,c_return,zeros,numpy,5,zeros,k.py,19 822467345598200,0,0,free,start,cpyquickhelper/profiling/event_profiler.py,109,<module>,k.py,19 822467345600400,0,0,free,start,cpyquickhelper/profiling/event_profiler.py,109,<module>,k.py,19 822467345600900,0,0,return,ndarray,numpy,5,ndarray,k.py,19 822467345603200,0,0,call,stop,cpyquickhelper/profiling/event_profiler.py,128,<module>,k.py,19 822467345604900,0,0,call,_restore_profiler,cpyquickhelper/profiling/event_profiler.py,168,stop,cpyquickhelper/profiling/event_profiler.py,151 822467345605600,0,0,c_call,setprofile,sys,168,setprofile,cpyquickhelper/profiling/event_profiler.py,151
Links:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cpyquickhelper-0.3.404.tar.gz
(162.9 kB
view hashes)
Built Distributions
Close
Hashes for cpyquickhelper-0.3.404-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ee383e17503adf9a1a02041431bea97f27292609775e6657d1bc900933a4683 |
|
MD5 | 9987c00d13f75d901b43cf47fd6252fe |
|
BLAKE2b-256 | 37c5b1b82ba852f8267cdcafea227fdeb70f5c2b1b9a30cd8ec1126d12db2e78 |
Close
Hashes for cpyquickhelper-0.3.404-cp310-cp310-manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 222af94debf3e1bf631c6c89abe511eb9f8f289ba5e55a7eaa305f3e8a0c22e3 |
|
MD5 | b8544abe6ed537b4fb82c0c73a26297b |
|
BLAKE2b-256 | def10c08f4b44b14ca6032a5a77d0692bb7b70ba1780dea2ba3749dda8a4a082 |
Close
Hashes for cpyquickhelper-0.3.404-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f269e55a898f4ba748834d1fd7a09dd60cc67a8f7d022d4e19af25e08cab2ecf |
|
MD5 | e2aca0f88af3493b8ecdaff45c7cef87 |
|
BLAKE2b-256 | 835c63f4ea7f33a1afb16a97a09863fcd0b38a1421471bafd2182379ec5264e3 |
Close
Hashes for cpyquickhelper-0.3.404-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78297c9d8c1a260544c3e53f72d5226f0f1dd6be84596975f6323da07d8e07d5 |
|
MD5 | 039541428153d432a77f26542fb3f55d |
|
BLAKE2b-256 | cc485d1a0be2a5898125fe012592be82013e3bc5df42d27514584f4af3d7cc60 |
Close
Hashes for cpyquickhelper-0.3.404-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3104dc8f302b68bffb820bec8345515f75390a632a6b13cfbea98147ec4a61ff |
|
MD5 | b4ab6be318481fe59fbed2f98ce8c794 |
|
BLAKE2b-256 | f651855016e95fe0a437e8b693842899b1ee98d94512947547f05dec1d589313 |
Close
Hashes for cpyquickhelper-0.3.404-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e10b5aaec41afcbcf2d7d632642c3a9504d9cbe6af877eea90c1a19ac73f1cd |
|
MD5 | c03e3d0b17fa3d2385299f59c79cdf5e |
|
BLAKE2b-256 | a6ed421cc0bb2d3ee8dd2c964e9e4fbd5cbdc3e157fc7facabf0c4003c7cd184 |
Close
Hashes for cpyquickhelper-0.3.404-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f809370d27ac4ef28479a10f06825a4659fc78e5e75bb86ae59af0db0c76465f |
|
MD5 | 47224b2d42b69b55d459a264d1066f08 |
|
BLAKE2b-256 | c6741f37cd9350236a2d1e63bdfce6be5cdd00341dd800427dabcf71c9be658c |
Close
Hashes for cpyquickhelper-0.3.404-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | abfe8f9a3583b1687276912ba948726af7babf980d93deb5bf294fabe44694f4 |
|
MD5 | 9d705eeaf79eca04d9499d20400208bf |
|
BLAKE2b-256 | a2349117d878826e8d89f649ff1f3dffff7ab0bcc94bd177d550f12edcba45c4 |
Close
Hashes for cpyquickhelper-0.3.404-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5ed86e9c33419d98bbda25a8dd8978e0c01b29bd4435562b945ff104055fc67 |
|
MD5 | 9eb6e8c4690d2e606369c8301876794a |
|
BLAKE2b-256 | d8f0f05e9accf4156c137abe558e73d8bfe92c60ffdfd461fbc9e2df25dad977 |
Close
Hashes for cpyquickhelper-0.3.404-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1102e30ad3b3a3518d7a3148fc5dd766813aa06f26ba91270d561d57294ccd0d |
|
MD5 | 46bca4755417ee009788d7a0ef9635c7 |
|
BLAKE2b-256 | 29fd42813db919babf759c217214f0d18c985729b61fccc0bea42b6c76d35648 |