-
Notifications
You must be signed in to change notification settings - Fork 119
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
Line break will double 'Hit' #106
Comments
I noticed something similar today in my own use. Because I'm not the original author, I'm not sure if this is intended behavior or not. If someone want's to dig into this, it would be good to have docs on why this happens. |
I just discovered this as well. It seems to be a regression because I was comparing the same code on Python 2 (with line_profiler < 3.0) and on Python 3 with latest version, and this did not happen on the Python 2 version. Relatedly it seems on Python 2 the first line does not have any time recorded, whereas on Python 3 it shows the full time for that line but it's double-counted, leading to misleading results. Not sure if this is part of an intentional change or not. Will investigate further... |
From what I can tell it kind of makes sense. The first count is from any sub-expressions on the first physical line (typically ~0us if it's just something like A little confusing but makes sense in a way. Maybe just a documentation patch is sufficient. But I'll try the 4.0 branch. |
Actually, I was investigating a difference in reported line hits on some random programs in my personal test suite between v3 line_profiler and the potential v4, and I wonder if this could be the cause. I originally figured v4 had a bug, but if this is actually happening in v3, then I'm fairly sure v4 fixes the bug. |
I'm still having this issue with line-profiler 4.1.2. Seems to me like a bug as just separating arguments onto a new line to reduce line width will make the hits double counted and half the real per hit time. |
I'm still having this issue with line-profiler 4.1.3. |
I have test code
then I try
then I get
It's seems line break will double hit and get a wrong per hit time. Is this a bug?
The text was updated successfully, but these errors were encountered: