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

Inaccurate measurements of time (under some/all conditions?) #4

Open
ceefour opened this issue Oct 9, 2015 · 6 comments
Open

Inaccurate measurements of time (under some/all conditions?) #4

ceefour opened this issue Oct 9, 2015 · 6 comments

Comments

@ceefour
Copy link
Owner

ceefour commented Oct 9, 2015

From Ephraim Rubenstein effyruby@gmail.com :

I downloaded 3 Cachegrind viewers today.

  1. WebCacheGrind 1.1.0.16
  2. WebGrind and
  3. QCacheGring

WebCacheGrind is showing measurements approx 1/10 of the other 2

WebCacheGrind Zend\MVC\Application->init 49ms
WebGrind 492ms and
QCacheGrind 492 253 (microsecs)

This does not make sense .

Can you advise?

TIA

Efffy

@bbak
Copy link

bbak commented Oct 19, 2015

Same here. Version 1.0.0.14 (last one on Sourceforge) reports 9731 ms and current 1.1 973ms on the same .out file. A xdebug Profile is also ~ 9 Sec.

@augmenter
Copy link

I can confirm, 1.10.16 shows 14ms, while 1.0.0.14 shows 142ms.

1.0.0.14 above image, 1.10.16 below
cachegrind

@FractalizeR
Copy link

Same here

@ceefour
Copy link
Owner Author

ceefour commented Mar 17, 2016

I don't know when or if there'll be a fix.
Feel free to use an older version at https://github.com/ceefour/wincachegrind/releases

@FuryBart
Copy link

I can confirm the problem with the latest version. All times are 1/10 of the times in the cachegrind files. You can easily test it with just sleep(1) in a php file.
Funny enough, the problem is well kown since at least 8 years. See the issues at Sourceforge: https://sourceforge.net/p/wincachegrind/bugs/2/
Merijn Bosma said there, that he has fixed the issue in release 10.0.0.14. So someone has "fixed" it back.
It's even possible to work with that issue, but how hard could it be to add a multiplier of 10 to the times? Just an idea.

@istvan-ujjmeszaros
Copy link

istvan-ujjmeszaros commented May 20, 2024

Xdebug 3.1.6 is using 10ns units, and the millisecond calculations are perfectly fine in WinCachegrind 1.1.0.16.

FYI the problematic cachegrind file in the linked bug is oddly using 1 microsecond units, and is specifying it as "Time" in the header. Looks like WinCacheGrind is assuming 10ns units by default, maybe it is ignoring the unit defined in the events header? I think it would be great if the unit should just be configurable, no reason to try to autodetect it from the header.

I can confirm that everything looks great when I am looking at cachegrind files generated with Xdebug 3.1.6.
Everyone should update Xdebug to the latest version that is supported by their PHP version, as WinCacheGrind will show the proper values when the cachegrind file is using 10ns units:
https://xdebug.org/docs/compat

Actually, Webgrind is off by the fraction of 10 since this Xdebug PR was released:
xdebug/xdebug#619

QCacheGrind/KCacheGrind are just using the raw values, so they are totally unreadable due to printing the 10ns units as is.

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

No branches or pull requests

6 participants