Comments (3)
Can you post your program testpy.py
? I just verified that Scalene does work with arguments passed to the profiled program. Here's a test case.
import argparse
parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('integers', metavar='N', type=int, nargs='+',
help='an integer for the accumulator')
parser.add_argument('--sum', dest='accumulate', action='store_const',
const=sum, default=max,
help='sum the integers (default: find the max)')
args = parser.parse_args()
for i in range(1000000):
pass
print(args.accumulate(args.integers))
% python3 -m scalene testargs.py --sum 12 13 14
39
testargs.py: % of CPU time = 100.00% out of 0.04s.
| CPU % | CPU % |
Line | (Python) | (native) | [testargs.py]
--------------------------------------------------------------------------------
1 | | | import argparse
2 | | |
3 | | | parser = argparse.ArgumentParser(description='Process some integers.')
4 | | | parser.add_argument('integers', metavar='N', type=int, nargs='+',
5 | | | help='an integer for the accumulator')
6 | | | parser.add_argument('--sum', dest='accumulate', action='store_const',
7 | | | const=sum, default=max,
8 | | | help='sum the integers (default: find the max)')
9 | | |
10 | | | args = parser.parse_args()
11 | 87.99% | 12.01% | for i in range(1000000):
12 | | | pass
13 | | | print(args.accumulate(args.integers))
from scalene.
bump @josefwilfinger
from scalene.
hi. i am sorry. i dont know why, but now it works. i tried several times, before i wrote this. but now it works. sorry
from scalene.
Related Issues (20)
- Is there a way to measure time spent in GC? HOT 3
- GPU and memory columns not present HOT 7
- Python 3.11 support HOT 1
- defaults to cli HOT 2
- Segmentation fault profiling project
- Getting SIGSEGV with empty program HOT 5
- Probable bug with scalene when profiling async code HOT 1
- Wheel missing for Python 3.12 HOT 3
- Scalene does not seem to work with multiprocessing
- Unicode decode error after executing cupy code in ipython
- Scalene crashes on sklearn / statsmodel etc. imports HOT 10
- Include flags from environment variables set externally HOT 1
- GUI Filter: Display only functions / methods with profiled lines
- Discrepency between online GUI and the generated HTML HOT 1
- Ollama server is not detected HOT 3
- Environment variables from .env file are not loaded HOT 1
- Add ability to control whether `profile.html` is generated
- ImportError: dlopen with crdp.abi3.so, 0x0002: bad bind opcode 0x00 HOT 6
- Scalene doesnt work properly with torchrun / torch.distributed.run HOT 3
- scalene doesn't see code loaded via exec?
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 scalene.