Comments (6)
This profiler should profile functions inside imported python modules. If you can give me an example where it isn't doing this I'll be happy to investigate.
from python-flamegraph.
Ok, maybe I'm just missing something.
Let's look at a simle script test.py:
#!/usr/bin/env python
import math
def calculate_something(lst):
for element in lst:
math.sqrt(element)
calculate_something([x for x in xrange(1,10000000)])
When I run something like that:
python -m flamegraph -o perf.log test.py
I just get:
MainThread`_run_code;MainThread`<module>;MainThread`main;MainThread`<module> 484
MainThread`_run_code;MainThread`<module>;MainThread`main;MainThread`<module>;MainThread`calculate_something 35
MainThread`_run_code;MainThread`<module>;MainThread`main;MainThread`start;MainThread`wait;MainThread`wait 1
Where is the number for math.sqrt? Hot to get it?
from python-flamegraph.
It looks like you're on to something, it looks like my approach is unable to sample stackframes inside native c modules.
This module should work ok on pure python, but I need to figure out an approach for native code...
from python-flamegraph.
Take a look at Aaron Solowski's version: https://github.com/asokoloski/python-flamegraph
He's added support using signal.setitimer that will profile inside of c modules. The downside is you lose thread information, but depending on your use-case that's probably a good trade-off.
from python-flamegraph.
Any progress?
from python-flamegraph.
No, haven't been working in python recently. Pull requests would be considered. Have you checked out Aaron Solowski's version (linked in Jul 21 comment)?
from python-flamegraph.
Related Issues (13)
- Any docs on usage with wsgi apps? HOT 7
- Create PyPi package HOT 1
- Please publish a new release HOT 4
- profile Python program run as a module HOT 1
- Python 3.8 support HOT 2
- /usr/bin/python: No module named flamegraph HOT 1
- sdist is missing LICENSE
- jinja2.exceptions.TemplateNotFound: index.html
- jinja2.exceptions.TemplateNotFound: index.html
- flamegraph.py syntax error HOT 2
- Upload to PyPI HOT 1
- This script can't follow subprocess.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-flamegraph.