Profiling Python via C-api (How to ? ) -
i have used python's c-api call python code in c code , want profile python code bottlenecks. came across pyeval_setprofile api , not sure how use it. need write own profiling function?
i thankful if can provide example or point me example.
if need know amount of time spent in python code, , not (for example), in python code time spent, python profiling tools not want. write simple c code sampled time before , after python interpreter invocation, , use that. or, c-level profiling tools measure python interpreter c function call.
if need profile within python code, wouldn't recommend writing own profile function. provide raw data, you'd still have aggregate , analyze it. instead, write python wrapper around python code invokes cprofile module capture data can examine.
Comments
Post a Comment