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

Add an XDebug Profiling Command for Analysing Code Performance #126

Open
joshsedl opened this issue Apr 18, 2023 · 6 comments
Open

Add an XDebug Profiling Command for Analysing Code Performance #126

joshsedl opened this issue Apr 18, 2023 · 6 comments
Labels
enhancement New feature or request priority-low

Comments

@joshsedl
Copy link
Collaborator

We should add a command, that enables xdebug and puts it in profiling mode (xdebug.mode = profile).

This way, we can analyse our Code for performance, and see, where performance is problematic.

Unfortunately there is no maintained GUI for inspecting the profiling file properly under Windows. Our only option is WinCacheGrind. Under Linux, there is the maintained KCacheGrind by the wonderful KDE Team.

Solution: We should switch to a Linux based System 😵‍💫

@JPustkuchen
Copy link
Member

The GUI shouldn't be our problem. People using this will find a solution.
As ddev xdebug on already exists for ddev, I'd suggest to add a command like
ddev xdebug mode X
which can be any of these values:
https://xdebug.org/docs/profiler#mode

The risky part is, if someone forgets to change it back to a different mode... But no idea how to do it better, yet.

@JPustkuchen
Copy link
Member

BTW: Also see https://symfony.com/doc/current/profiler.html
which mitigates this a bit. I think this is what drupal webprofiler toolbar uses...

@joshsedl
Copy link
Collaborator Author

I am against an xdebug mode command, as we can enable multiple modes if needed, currently coverage and debug are enabled. And as we only enable xdebug during usage and disable it afterwards, we can just add "profile" to the roster, without hindering performance in any way.

For the GUI, the xdebug documentation recommends https://github.com/jokkedk/webgrind and https://sourceforge.net/projects/qcachegrindwin/ for Windows. See https://xdebug.org/docs/profiler

But yea, maybe the symfony profiler is actually the way to go! We should test both.

@JPustkuchen
Copy link
Member

Yes and I think we should indeed have both.
Sorry, my understanding was, that it's profile xor debug, but I might be wrong!

@JPustkuchen
Copy link
Member

JPustkuchen commented Apr 24, 2023

Separate issue for VSCode UI Integration: #128

@joshsedl
Copy link
Collaborator Author

Looks great! Thanks for the link!

@JPustkuchen JPustkuchen added enhancement New feature or request priority-low labels Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority-low
Projects
None yet
Development

No branches or pull requests

2 participants