Wednesday, March 7, 2012

Reducing the Network Footprint and Page Response of Telerik Controls in SharePoint

As part of an overhaul of our current SharePoint 2007 environment, we decided to implement some enhanced functionality. We used the Telerik Rad Controls to assist in providing rich interfaces without having to code everything custom. Our home page would contain at least 12 web parts that all utilized one or more Telerik controls including RadRotator, RadGrid, RadPanel, and RadTooltip along with RadAjaxManagers and Loading Panels.

This was all good. We had everything working, implemented some asynchronous calls and AJAX postbacks, etc. It was pretty quick in IE 9. However, since most user machines were still running IE 7 with Windows XP, the performance wasn't as great. The initial page load of the home page was horrible and this was in the same city as the servers - imagine the response on the West Coast, U.K., China, etc. So obviously we did a ton of digging and various optimizations with the code and environment.

One of the simplest things which we didn't actually do until almost last, was to reduce the amount of calls between the client and server machines. Initially we blamed Telerik for producing a large overhead on the page when there are many different controls implemented. Looking at the trace showed many WebResource and ScriptResource calls:


(click on image to see larger view)

At the point of the above trace, all the calls were less than 1ms (I have seen them higher) but there seemed to be a lot of chatter here. What are all those ScriptResources anyway? These are the loading of javascript that is embedded in the Microsoft and Telerik assemblies.

I found a great way to combine the Script Resources into one call. This involves knowing exactly what is being called from your page. Luckily there is a Script Reference Profiler assembly which produces exactly what you need. This assembly is available on CodePlex and there is some documentation on how to use it on DotNetCurry.com.

Essentially the result is adding the used script resource references into your ScriptManager instance using the CompositeScript and Scripts tags. Since we were working in SharePoint, I added this to the master page:


This instantly combined all of the ScriptResource calls:




(click on images to enlarge)

Ok. This was good. But now what's up with those WebResource.axd calls? In the trace above they are taking longer than before. Reviewing the Response Body details of the WebResource.axd calls revealed that these were embedded CSS styles within the Telerik assemblies:






As it turns out, Telerik has a way to combine all of their CSS WebResource.axd calls into one! Again, in our master page, right under the ScriptManager, I added the RadStyleSheetManager:



I thought I was going to need to know which embedded stylesheets are being used, but since we are only using Telerik assemblies, the RadStyleSheetManager auto-magically handles them. Just by adding that one line combined all of the Telerik WebResource.asd calls into one call:




So now I have reduced the initial 20 calls into 3 combined calls - reducing network traffic, page response time, and overall rendering of the home page!


If you found this useful, please help support my SharePoint and .NET user group (Philly SNUG) by clicking on the logo below.

Sunday, January 22, 2012

Chasing Paper: A satirical look at selling consulting services



This is an adapted excerpt from my new mini e-book How  to Kill a Consultant. The excerpt is from the Chasing Paper section of the e-book and is a sarcastic dialog which represents a common scenario for consulting firms that “specialize” but when it comes down to it they take whatever contracts they can. 

Consulting sales people need to make their commission and get whatever signed paper they can - regardless of the work, price, duration, etc. Signed paper is what they are chasing and this helps in the killing of a consultant for sure.


Prospect: So now I see your consulting firm has various specialties - very good. My problem is not using a technology you focus on and I am not in the building stages. You see, I have some hacked programs and processes that are all fucked up and need someone to come in and clean it up because I don’t feel like dealing with this shit.


Sales Person: Oh great! Yes we have people to bill on your project and deal with your fucked up systems as long as you pay us and sign this contract. That’s all I really care about is this signed contract. I’ll get my commission and we’ll send in some guys for you. They’ll hate the work and slave over all your bullshit processes but both you and I won’t have to worry about it anymore.

Prospect: That’s great! I really need your best guys but since this isn’t a hot technology, I am not paying you that much as a billable rate. I can get someone else probably cheaper. So I want your best guys at the lowest rate possible.

Sales Person: Yes some of our best guys are coming off a project as we speak and since we don’t want to pay them for sitting on the bench and increasing their value in their specialty, we’ll stick them on your fucked up project and stress them out a bit. They want to bill those extra hours I am sure. They’ll love it here. Like I said, once you sign that contract I am out of here and I don’t give a shit what happens afterwards. It all becomes technical after that. I need to find some other fucked up project.



Consultant: So now I am working on some fucked up process using a technology I have no clue about and really don’t care about. I will bust my ass worrying about this bullshit client all while losing my edge on my specialty areas. At least I am getting paid for those billable hours - . plus I get to deal with this shit for 50 hours a week to boot. I will have no time to keep up with technology I am passionate about yet my firm will still see me as an expert. Two years later when I am off this project I’ll finally be put on a project using my technology and I will have forgotten every single thing about it. I love my job!


So basically signed contracts are king and it really doesn’t matter what the contract is for or what technology is being used. Signed paper is signed paper and the sales people chase it for a living. That’s all that matters because at the end of the day it results in more billable hours. There is just one expense - the killing of a consultant.

READ THE ENTIRE E-BOOK ON AMAZON!


FREE for Kindle Owners with Amazon Prime!

Thursday, January 5, 2012

Happy Days for 2012

I decided that for this new year (and hopefully every new year) I will attempt to have a great day - every day. I call these "happy days". I find or think of something each day that makes it a happy day. Whether it is while it was happening or reflecting back at night, just finding one or two things can make you feel good about your day, your week, and your life.  You can't have a great year if you don't have great days!

Day 1 - 1/1/2012
Today I checked my millionaire raffle tickets and found that I won $100.00. I tucked the ticket away for next weekend in which my wife and I will have a date night. Tonight we decided on a date night as well. We received a movie gift card over the holidays and she had one from before with $5 left. While going through her pocketbook, she found several old movie gift cards. We didn't know if there was anything on them but we needed to leave to get to the movie in time. We wanted to see the new Mission Impossible movie in the IMAX theatre. The old gift cards had some cash on them and our tickets were covered, We use a loyalty card there and on the receipt it showed we reached our next $10 credit. Our food was $20, we used the $10 credit and then had some left on the cards. I only had to pull out $4.50 in cash. So this is great. We get to go to the movies with food for only $4.50!!!

In the theatre, there was something wrong with the IMAX system and it needed to be rebooted. It took really long for them to get started so they ended up giving us free passes for next time! So now the next time we go, we'll at least get free admission. This was a happy day that ended great!

Day 2 - 1/2/2012
Today was the Winter Classic and two of my brother-in-laws came over. Since I was recovered from New Year's Eve, I decided to have more beer while watching the game. I think I had too many (again) but I felt great. However, this didn't make it a happy day. I was happy today because I forgot that there were still four spotlights in my family room that weren't replaced with CFLs - so they were still the filament kind burning 65 watts each. They are in the "bar room" area which is used for Xbox w/Kinect action, so the lights are on all the time. I previously scoped out using LED lights and found a dimmable model reduced to $15-something. I bought one to see where in my house I could use it. Even though it wasn't the BR-40,PAR-40, or R-40 spotlight types that fully fit in the family room recessed lighting structures, it did look nice in there and the light was bright white. I decided that I would use my test one in the living room lamp which is on almost all night and go get four more for the family room. Well today was the day for that. While my wife was looking for shoes at the shoe store, I decided to run over to get those light bulbs. Guess what? They only had four left and now they were reduced to $12.98!! Bonus! I felt great putting them into the lighting structures. Each one costs only 90 cents a year to run and the bulb should last for 20-25 years! That is estimated but even if only lasts 10 years and costs me $1.80/year to run - I'm still lovin it!

Day 3 - 1/3/2012
Back to work for the holiday but it was a happy day! One of my New Year's resolutions was to start getting coffee at work instead of going to Starbucks 2-3 times a day. I only get regular coffee but it still costs around $2.25-$3.00 after I drop some change in the tip jar. So wow, even though I don't get the fancy $5 mocha carmel machiata frappacino skinny vanilla lattes, it still adds up! I figured I was spending at least $100/month but probably more like $120-130/month. So today I took my new Drexel University coffee mug to the kitchen at work and made myself some K-Cup french roast coffee. It felt great! I saved time in the morning since I didn't have to stand in line and saved money! Looking back, I also made the 8:00 train instead of the 8:20. Even though I like to get in earlier than that, at least I wasn't stuck coming in later. The night ended up happy too but I'll leave it at that. Three happy days in a row!

Day 4 - 1/4/2012
Another day at work and things were going well. Again, I didn't go to Starbucks so that made me happy but I can't use that again for it being a happy day (although keeping happy things happening every day does help make it a happy day). My wife and I had some miscellaneous checks from the holidays and belated birthdays. Today I ran next door from work and deposited it them into our account. We decided to use this towards our date night on Saturday. It felt good putting some money away for fun. Later at the dinner table, my son told me that is is not leaving the TV on all night anymore. I thought with his new TV he was using the sleep mode (which his old CRT type had anyway) but he said he wasn't even using that anymore. So now his new LED TV which only costs $13/year to watch should actually only cost about $13/year or less (since the usage was based on 5 hours/day). Saving money for fun and saving money on electricity in the same day! What a happy day!

Day 5 - 1/5/2012
Today was very busy at work. I wanted to get some processes coded and working but I ran into some issues which I thought would not make it a happy day. However, I was able to get everything done by the end of the day before I left work - so I was happy for that. Found out that they have creamers in the other refridgerator at work - I was using the powder stuff all week. So now my coffee is even better and free! When I came home from work I had a package! I ordered some copies of my self-published books a few days ago and they came today. Everyone loves getting packages. My wife came home from work after 9:00pm and she said she got her paycheck (they don't have direct deposit) - yahoo! We will be using her paychecks to clear off some bills! I want one bill gone by the end of March. Need to figure out which one - furniture, Macy's, or Dell. This is the last year for my car payments on my Jaguar anyway and it is a low percentage rate so it wouldn't make sense to send it there (plus I have been way ahead of schedule on it). Another great happy day!

Day 6 - 1/6/2012
Well shit it is Friday so it should be a happy day no matter what. I thought so but it was dampered by the fact that my wife didn't get too much sleep because my oldest daughter came in late and caused lots of sleep interuptions (i.e. making noise). This caused some grief but I was able to get some things done at work to balance this. The day ended with some beers and some happy times for me.

Day 7 - 1/7/2012
I decided that writing so much on each day was becoming a chore. So just a few points for happy days now. Tonight was date night with the wife. Dinner, Parx Casino, and then The Red Rooster to see an Irish Band. Great day and night out!
Day 8 - 1/8/2012
Football
Relaxing Day
Day 9 - 1/9/2012
Monday was tough because it was Monday but it was a good Monday. Stuff done at work and home.
Day 10 - 1/10/2012
Had to help my daughter with her paper which was not so great but the happy part was getting it about 60%-70% complete.
Day 11 - 1/11/2012
Irish Dancing - St. Patrick's Day Parade practice
Day 12 - 1/12/2012
One of the beta exams for Office 365

Having to update this for each day is becoming a chore and therefore I won't do that anymore. I think everyone gets the idea including myself.

Wednesday, October 12, 2011

Adding Klout to SharePoint: Klout Web Part


My vision for a Klout web part was to have a control that served two purposes. The first purpose would be to allow users to enter their Klout account (if one wasn't entered already) which would then get stored in their profile. The second would be to actually display the Klout Score in the web part if the account was previously entered.

The steps to performing this are as follows:




  1. Create a Visual Web Part that loads an .ascx control
  2. Create a control that has at least a text box and button for the user to enter their Klout account.
  3. Have the button update the SharePoint User Profile with the Klout account (see previous post for info on the custom property)
  4. Have the web part render the Klout Widget image if the user's profile contained a Klout account.

I have a step-by-step walkthrough of these tasks in my guide here.
The steps in the guide are based on SharePoint 2010, however, it is a similiar process for SharePoint 2007 and SharePoint Online (via Office 365).

There are also instructions contained in the guide on how you may access and download code that assists in integrating Klout with SharePoint.



If you found this useful, please help support my SharePoint and .NET user group (Philly SNUG) by clicking on the logo below.

Monday, October 10, 2011

Adding Klout to SharePoint: Search



When I thought of integrating Klout scores into SharePoint, the first thing I thought of was the People search results. This made sense since when searching for people in an organization, you would easily be able to see their Klout score with their information.

The steps to performing this are as follows:



  1. Add a custom property to the User Profile Service.
  2. Crawl People to generate a new crawled property based on the new user profile property.
  3. Create a Managed Property for search that maps to the crawled property.
  4. Modify the People Search Core Results XSLT to display the Klout Widget incorporating the new search managed property.

I have a step-by-step walkthrough of these tasks in my guide here.
The steps in the guide are based on SharePoint 2010, however, it is a similiar process for SharePoint 2007 and SharePoint Online (via Office 365).

There are also instructions contained in the guide on how you may access and download code that assists in integrating Klout with SharePoint.



If you found this useful, please help support my SharePoint and .NET user group (Philly SNUG) by clicking on the logo below.

Matched Content