-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
force_print
argument for output behaves strange
#657
Comments
I agree that this looks unintuitive but that line of code has been in the codebase for 2 years. Can you point to a bug here? |
I think the issue is that there seems to be no way to output only the functions I care about (but maybe there's another way?), only the full file. The |
So I see that there is some code that is always executing now that |
I see. No, I use |
It's the same mechanism, but it was never intended to be called directly. I like the idea of listing a bunch of functions to profile without selecting them one by one. Can you give me an example of how you are doing this? Might make sense to expose an API. |
The usecase is that I have for func in [mylib.func1, mylib.Class1.method1]:
scalene_profiler.Scalene.profile(func)
logger.log(10, f"{scalene_profiler.Scalene.__dict__['_Scalene__functions_to_profile']=}")
scalene_profiler.Scalene.start()
func_to_run(*args, **kwargs)
scalene_profiler.Scalene.stop() Unrelated, but something that I found useful is to start scalene from within a python script with pre-configured parameters. This removes the need to know or remember to run the script as |
https://github.com/plasma-umass/scalene/blob/6980cb0c41df6ae724a2ce8d4686398b4b058853/scalene/scalene_json.py#L109C12-L109C15
Shouldn't it be
if force_print and not ...
? The printing will happen ifforce_print=False
.The text was updated successfully, but these errors were encountered: