NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Profiling Questions / Requests


Joined: 06 Sep 2008
Posts: 16
Reply with quote
Good morning,

The past week I've been making greater use of the profiler for some pull requests I was working on for the Joomla project (at the moment I'm probably one of the few that uses PhpEd for my regular PHP work in the project).

Since I've been using it more I had some questions regarding reported memory usage that I was curious about along with some suggestions that perhaps could be implemented in the profiler.

The main question I had about memory usage was an instance I saw last night where I was profiling a page, and while the page total was only about 50 MB of memory usage, in the profiler it also showed the PHP CORE (particularly a lot of str_replace calls) as using up about 1.3 GB of memory which I thought was pretty crazy, but obviously the page itself hadn't used that much memory so I was just curious about how I should interpret figures like that when I see them? For the most part as well I'm sort of ignoring the "with children" column too since it doesn't seem to be as useful, at least for what I've had to do so far.

On a separate note, here are a few requests I had for the SQL Profiler:
- Add a summary count number in (so we can easily see how many queries were executed on a particular page...right now we have the overall timing information, but nothing on how many queries were run which is usually just as valuable to know).
- For the profiler we have in Joomla, I added a feature a few years back to find duplicated queries. How we do that is by concentrating on any SELECT queries only and then only collecting the query string from the beginning up until where the WHERE clause begins and then collecting counts for each of these groupings. The reason for this, is particularly for a lot of applications I've worked with, there is a tendency for a lot of fairly duplicate queries to be run on a page (e.g. SELECT * FROM foo WHERE bar = 1, SELECT * FROM foo WHERE bar = 2, etc.) but if you exclude the WHERE part of the query you end up with a unique grouping (e.g. SELECT * from foo) that you can use to help identify a portion of the application that might be running a lot of duplicate queries (and therefore slowing down the page). Currently with the SQL profiler in PhpEd, since there's no information on duplicate queries so it's difficult to identify these situations.

Lastly, this one might already be possible but I commonly have the page I want to debug or profile already open within the Output Tab in PhpEd (e.g. in Joomla let's say /administrator/index.php?option=com_content)...I can add DBGSESSID=1 or -1 values if I want to debug or not debug, but I don't know if there's a value that can be used for profiling too? If so that's something quick that would be usable...however, overall having to add in the URL parameter is not as user friendly...I seem to remember the Run/Debug/Profile buttons could be clicked on as well from the Output Tab (but my memory could be faulty)...in any case though, right now from the Output Tab they are grayed out and it would be nice if you could activate those modes directly by clicking on a button Smile.

Thank you (looking forward to version 16)!
View user's profileFind all posts by orwareSend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
Both the DBGSESSID parameter and the DebugBreak() statement accept the same argument format.

Details are at http://forum.nusphere.com/faq-what-is-dbgsessid-syntax-t586.html

You can use DBGSESSID=1;p=1 to start the profiler
View user's profileFind all posts by plugnplaySend private message


Joined: 06 Sep 2008
Posts: 16
Reply with quote
@plugnplay

Thanks for your reply!

Now that you mention it, I do recall seeing the ;p=1 part in the URL at sometimes and never connected that to the profiler but that makes sense.

Thank you!
View user's profileFind all posts by orwareSend private message
Profiling Questions / Requests
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic