Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

xDebug profiler in PM?

Comments in 'Plugin Development' started by Legoboy0215, Jun 5, 2016.

  1. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    Is it possible to use it? I set xdebug.profiler_enable to 1 in php.ini but it hasn't done any good. My plugin code is causing CPU usage to spike over 100%, and I'd like to know why :)
  2. andre_the_gamer
    Offline

    andre_the_gamer Active Member

    Joined:
    Feb 5, 2015
    Posts:
    112
    Minecraft User:
    Andre_The_Gamer
    Xdebug's Profiler is a powerful tool that gives you the ability to analyze your PHP code and determine bottlenecks or generally see which parts of your code are slow and could use a speed boost. The profiler in Xdebug 2 outputs profiling information in the form of a cachegrind compatible file.
  3. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    That is useless information. Are you trying to raise your post count?
  4. SOFe
    Offline

    SOFe Banned

    Joined:
    May 28, 2016
    Posts:
    386
    Minecraft User:
    Herobrine
    CPU usage of 100% or server load of 100%? That's different. Your server can be doing nothing and simply get suspended (e.g. by MySQL queries).

    I think the Timings in PocketMine can serve the function of the Xdebug profiler already, if you use it properly, e.g. add custom timings.

    Or if you love hacking, you can play with threads and collect statistics about the stack trace in the main thread from other threads.
  5. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    My timings are all usual, and server is very stable.
  6. SOFe
    Offline

    SOFe Banned

    Joined:
    May 28, 2016
    Posts:
    386
    Minecraft User:
    Herobrine
    So what's the problem? Timings should reflect all the data if you use it properly.

    Unless you start threads wrongly.
  7. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    It is possible to use it, enable it in php.ini (extension zend.xdebug or so), make sure in your bin folder theres a xdebug dll file, and in pocketmine.yml enable debugging and set level to 2. I think a php7 version of xdebug is out. Remember: xdebug causes alot cpu load etc.
  8. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    I'd stop using Linux if a .dll file pops up...

    Any ways, I tried to find a compiled xDebug for PHP7 but ended up being too lazy to compile it myself.

Share This Page

Advertisement