Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
cztomczak opened this issue Apr 26, 2018 · 1 comment
Labels
Milestone

Comments

@cztomczak
Copy link
Owner

cztomczak commented Apr 26, 2018

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

@cztomczak cztomczak changed the title Add --enable-profiling flag to build.py tool to enabling profiling using cProfile tool Add --enable-profiling flag to build.py tool to enable profiling using cProfile tool Apr 26, 2018
@cztomczak cztomczak changed the title Add --enable-profiling flag to build.py tool to enable profiling using cProfile tool Add --enable-profiling flag to build.py tool to enable profiling using cProfile module Apr 26, 2018
@cztomczak cztomczak added this to the v66 milestone May 22, 2018
@cztomczak
Copy link
Owner Author

--enable-profiling and --enable-line-tracing flags added in revision ef76811.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant