View xdebug cachegrind files on Mac OS

Xdebug is key when it comes to optimizing PHP code. Today, I heard my colleague boot up a Windows machine just to run an application that could interpret a cachegrind file generated by our development server… surely there must be a Mac equivalent! The following instructions will let you interpret cachegrind files locally on your Mac. You’ll still have to download the cachegrind file locally from your server.

Note that I’m doing this on Mavericks 10.9.2. I will not explain how to install Xdebug on your server or how to create the cachegrind file.

First, install Homebrew on your machine. From your terminal, run :
[shell]
ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
[/shell]

Then, run :
[shell]
brew install qcachegrind
brew install graphviz
[/shell]

Then, download your cachegrind file locally to your machine and, to view the output, simply execute

[shell]qcachegrind cachegrind.out.26620[/shell]

You will get something that looks like this :

Screenshot of what qcachegrind produces.
Screenshot of what qcachegrind produces.

Optimize away!

PS: For live debugging via xdebug, I use codebugapp.com.

35 thoughts on “View xdebug cachegrind files on Mac OS”

  1. Pingback: crash test dev
  2. Great blog right here! Additionally your website so much up fast! What web host are you the usage of? Can I get your affiliate link for your host? I wish my website loaded up as quickly as yours lol|

  3. Hello! I’ve been reading your web site for some time now and finally got the bravery to go ahead and give you a shout out from Humble Texas! Just wanted to mention keep up the excellent work!|

  4. Hi, Neat post. There is a problem with your site in internet explorer, might test this? IE nonetheless is the market leader and a large section of folks will leave out your magnificent writing because of this problem.|

  5. May I just say what a comfort to uncover someone who actually understands what they are discussing online. You certainly understand how to bring an issue to light and make it important. More and more people have to read this and understand this side of your story. I was surprised that you are not more popular since you definitely possess the gift.|

  6. Its such as you read my thoughts! You seem to grasp so much approximately this, like you wrote the e-book in it or something. I believe that you simply can do with some percent to force the message house a bit, however other than that, this is wonderful blog. A fantastic read. I’ll certainly be back.|

  7. Great weblog right here! Also your site rather a lot up very fast! What web host are you the use of? Can I get your associate hyperlink in your host? I want my web site loaded up as fast as yours lol|

  8. I am extremely impressed with your writing skills as well as with the layout on your blog. Is this a paid theme or did you customize it yourself? Either way keep up the excellent quality writing, it is rare to see a nice blog like this one nowadays.|

  9. I really like your blog.. very nice colors & theme. Did you make this website yourself or did you hire someone to do it for you? Plz answer back as I’m looking to construct my own blog and would like to know where u got this from. cheers|

  10. Its like you read my mind! You seem to know so much about this, like you wrote the book in it or something. I think that you could do with some pics to drive the message home a bit, but other than that, this is fantastic blog. A great read. I will definitely be back.|

  11. Right here is the right webpage for anybody who hopes to find out about this topic. You understand so much its almost tough to argue with you (not that I really would want to…HaHa). You definitely put a fresh spin on a topic that has been written about for many years. Wonderful stuff, just great!|

  12. Just wish to say your article is as surprising. The clearness on your publish is just spectacular and i could think you’re a professional on this subject. Fine together with your permission let me to grab your feed to keep up to date with imminent post. Thank you a million and please continue the rewarding work.|

  13. Hello there, simply turned into aware of your blog through Google, and found that it is truly informative. I’m going to watch out for brussels. I will appreciate for those who continue this in future. Numerous people will likely be benefited from your writing. Cheers!|

  14. Hello there, There’s no doubt that your site could be having internet browser compatibility problems. When I look at your website in Safari, it looks fine however, when opening in IE, it has some overlapping issues. I simply wanted to give you a quick heads up! Aside from that, excellent website!|

  15. What i don’t realize is actually how you’re not really a lot more well-preferred than you may be right now. You are so intelligent. You realize therefore significantly relating to this subject, produced me individually imagine it from numerous varied angles. Its like men and women aren’t interested until it’s one thing to do with Girl gaga! Your personal stuffs great. All the time handle it up!|

  16. Whats up this is somewhat of off topic but I was wanting to know if blogs use WYSIWYG editors or if you have to manually code with HTML. I’m starting a blog soon but have no coding knowledge so I wanted to get advice from someone with experience. Any help would be enormously appreciated!|

  17. I was wondering if you ever thought of changing the structure of your site? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having 1 or two pictures. Maybe you could space it out better?|

  18. Wonderful beat ! I would like to apprentice even as you amend your website, how can i subscribe for a weblog site? The account helped me a acceptable deal. I were tiny bit acquainted of this your broadcast offered shiny clear concept|

  19. I’m really inspired together with your writing talents and also with the layout in your blog. Is that this a paid subject or did you modify it yourself? Either way stay up the excellent high quality writing, it is rare to peer a nice blog like this one today..|

Leave a Reply

Your email address will not be published. Required fields are marked *