Wednesday Apr 02, 2008
Wednesday Apr 02, 2008
Mysql uses mysql_execute_command() to execute queries. Looking at the callstack you can see very clearly that mysql_execute_command() calls open_and_lock_tables which then tries to open tables via open_table(). The code path gets interesting here. As you can see in the image above, (and in the svg callstack), there is tight for loop. Looking closely (moving your mouse over the area in the svg file), you will see that the code is basically traversing a hash list! Not the best thing to do with a hashtable. Looking at the code, it is originating at line number 2781 in sql/sql_base.cc. Can it be improved? Most probably. Will it help if we improve it? Definitely for some cases, maybe not for others.
I found a few more interesting places in the code, but I will save them for my future blogs
Neel, the call graph visualizer is very cool! the svg version enables deep dives ,in a smooth fashion, to focus on interesting pieces of the timeline.
Which leads me to think - now that OpenSolaris Ruby is DTrace enabled, the visualizer could be used to help visualize Ruby call stacks.
DTrace is one of the cool things to happen to Ruby profiling, and hooking it up with a good visualization tool is, imo, the next step.
Posted by Prashant Srinivasan on April 02, 2008 at 06:10 PM PDT #
Posted by Matt Ingenthron's Stream of Consciousness on April 02, 2008 at 06:50 PM PDT #
Now that I see the svg file on your blog, it looks excellent. I l look forward to using this for networking. Good work.
Posted by amitab on April 03, 2008 at 10:47 PM PDT #
Very cool!
Posted by Mikael Gueck on April 07, 2008 at 07:51 AM PDT #