Monthly Archives: April 2014

Live Bookmarking in ANTS Performance Profiler: a killer feature to help you zero in on performance problems fast

Last week I was sat with Simon, one of my client’s managers, as he showed me around their new customer support centre web app highlighting slow-loading pages. Simon, along with a couple of others, has been playing guinea pig using the new support centre in his day to day work.

The main rollout is in a few weeks but the performance problems have to be fixed first so support team members don’t spend a lot more time on calls, forcing customers to wait longer on hold before speaking to someone. Potentially bad for costs, customer satisfaction, and team morale!

Simon gave me a list of about a dozen trouble spots and I remoted into their production box to profile them all. I had to collect the results and get off as quickly as possible to avoid too much disruption; I could analyse them later on my own laptop. This gave me plenty of time to hunt down problems and suggest fixes.

I used Red Gate’s ANTS Performance Profiler throughout. One of the many helpful features it includes is bookmarking. You can mark any arbitrary time period in your performance session, give it a meaningful name (absolutely invaluable!), and use that as a shortcut to come back to it later.

For example, here I’ve selected the “Smart search” bookmark I created whilst profiling the support centre:

Timeline with bookmarked region selected.

The call tree shows me the call stacks that executed during the bookmarked time period. Towards the bottom you can see that SQL queries are using the vast majority of time in this particular stack trace:

Call tree showing call stacks within bookmarked region on timeline.

(Identifying SQL as a problem I took these queries and analysed them in more detail using both their execution plans, and SQL Server’s own SQL Profiler. I then suggested more efficient queries that could be used by NHibernate via repository methods.)

Also note we’re looking at Wall-clock time as opposed to CPU time. I won’t talk about the differences in detail here. What you need to understand is that Wall-clock time represents actual elapsed time. This matters because the queries execute in SQL Server, outside the IIS worker process running the site. Under CPU time measurements, which only include time spent in-process, they therefore wouldn’t appear as significant contributors to overall execution time.

Back on point: bookmarking is great as far as it goes, but you have to click and drag on the timeline after the fact to create them yourself. In the midst of an involved profiling session this is a hassle and can be error prone: what if by mistake you don’t drag out the full region you need to analyse? All too easily done, and as a result you can miss something important in your subsequent analysis.

Step in Live Bookmarks.

Basically, whilst profiling, you hit a button to start the bookmark, do whatever you need to do in your app, then hit a button to save the bookmark. Then you repeat this process as many times as you need. No worries about missing anything.

Here’s how it goes in detail:

  1. Start up a profiling session in ANTS Performance Profiler.
  1. Whilst profiling, click Start Bookmark. (To the right of the timeline.)

Start a live bookmark.

  1. Perform some action in your app – in my case I was clicking links to navigate problem pages, populate data, etc.
  1. Click Stop Bookmark.

Stop (and save) a live bookmark.

  1. The bookmark is added to the list on the right hand side of the timeline. It’s generally a good idea to give your bookmark a meaningful name. To do this just click the pencil icon next on the bookmark and type in the new name.

Rename bookmark.

  1. Rinse and repeat as many times as you need.
  1. When you’ve finished, click Stop in the top-left corner of the timeline to stop profiling.

Stop profiling.

It’s a good idea to save your results for later using File > Save Profiler Results, just in case the worst happens, and of course you can analyse them offline whenever you have time.

And that’s it: nice and easy, and very helpful when it comes to in depth performance analysis across a broad range of functionality within your application.

Any questions/comments, please do post below, or feel free to get in touch with me directly.

Reminder: Demoing Node Tools for Visual Studio 1.0 Beta at NodeJS & JavaScript Cambridge TONIGHT!

Hey everyone, just wanted to put out a quick reminder that I’ll be demoing the latest Node Tools for Visual Studio 1.0 Beta at the NodeJS & JavaScript Cambridge meetup tonight.

It all kicks off at The Fountain on Regent Street from 7.45pm with beer.

I do love events that start off with beer, particularly ones where I’m speaking because it takes the edge off a little. Sign up at:

http://www.meetup.com/NodeJS-Cambridge/events/164845272/

Also speaking is my friend, and former colleague, Forbes Lindsey. He is an active Jade contributor and will be giving a talk entitled The Jade template language, which I would highly recommend.

It should be a fun and interesting evening, with plenty of time for questions and discussion, so do come along if you can. I’ll certainly be happy to receive any feedback or suggestions you have for Node Tools for Visual Studio, and will pass it along to the team.

Look forward to seeing some of you there!

Node Tools for Visual Studio 1.0 Beta has landed

Those of you lucky enough to be at BUILD last week will no doubt be aware that Node Tools for Visual Studio 1.0 Beta has just been released.

Here are some of the headline improvements:

It’s also worth calling out the extensive Azure support in the suite, offering the ability to create, deploy, and debug Node apps on Azure (including on Linux) – exciting stuff!

Rather than have me talk too much about it, take a look at the videos the team have put together and see it in action for yourselves:

  • Installation walkthrough from Pavel. There’s something very exciting in this video: you may not be aware, but Visual Studio 2013 is available for FREE for both startups, via BizSpark, and students, via DreamSpark.

See the full announcement on Soma Somasegar’s blog.

As ever, please have a play. We’d love to hear your feedback so please get involved in the discussion. Also, do please let us know about any bugs you find.

Video blog: Getting started with relational databases using IntelliJ IDEA 13

Recently I’ve been reacquainting myself with technologies I haven’t had to use in anger for a while. One of these is Java. This has been great because I’ve been able to get back into using my favourite Java IDE: IntelliJ IDEA from JetBrains.

I’ve also started playing around with video blogging, which I’ve been meaning to do for a while. Nowadays tools like the excellent (and free!) Expression Encoder from Microsoft (sadly no longer under active development) make very easy.

Here are the firstfruits of my labours – a quick video on getting started with relational databases using the Database Tools in IntelliJ IDEA 13 Ultimate Edition.

In this video I show you how to use IDEA to work with SQL Server as a data source. On the face of it this might seem like an odd thing to do. That is unless you’re used to working in environments with fairly diverse infrastructure, in which case it’ll seem like an everyday and fairly pedestrian occurrence.

Topics covered:

  • Creating and configuring your SQL Server data source,
  • Installing the appropriate JDBC driver – a process which IDEA automates to make it as easy as possible,
  • The database pane, which is similar to SQL Server Management Studio’s (SSMS) Object Explorer View,
  • The query editor, which provides intellisense/auto-complete, and knows the different SQL dialects of all the RDBMS’s for which IDEA provides explicit support,
  • The results pane; again very similar to SSMS’s.

What you end up with is an experience that offers much of the functionality you’d most commonly use within SSMS, but without having to step outside of the IDE.

If you develop on Windows and you’re used to SSMS you may not find yourself using this particularly often. If, however, you develop on another OS, you don’t have the SQL Server client tools installed, or you don’t want the hassle and overhead of stepping out of your IDE (SSMS is based on Visual Studio so can take a while to start), you should find the functionality in IDEA provides a convenient shortcut for working with SQL Server databases.

Enjoy!