Add --enable-profiling flag to build.py tool to enable profiling using cProfile module · Issue #424 · cztomczak/cefpython · GitHub
Skip to content

Add --enable-profiling flag to build.py tool to enable profiling using cProfile module #424

Description

@cztomczak

CEF Python is a C++ module written in Cython. Cython provides hooks for Python's cProfile module, so you can use Python's own profiling tools to see how Cython code performs. Once enabled, cefpython's Cython code will behave just like Python code when called from the cProfile module.

Also add --enable-line-tracing flag to build.py.

In the meantime to enable profiling, modify the tools/cython_setup.py file (line 380 - "cython_directives") by adding a new cython directive:

    "profile": True,

To enable line tracing also add:

    "linetrace": True,

After that file is changed follow the usual build instructions by executing the build.py script.

Cython profiling explained here:
http://cython.readthedocs.io/en/latest/src/tutorial/profiling_tutorial.html

For Python cProfile see:
https://docs.python.org/2/library/profile.html

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions