Slow Performance: Sharethis/Addthis

Mar
12

In between sessions at Drupalcon DC I was asked if Trellon generally implements bookmarking tools such as, sharethis or addthis, for clients? I started to answer that we have no preference but stopped myself when I remembered a client situation with Sharethis. When the Sharethis component was installed it made page load times slow and it had some script caching issues. In this situation it resulted in page loads of over 20 secs and obviously lead to us having to seek an alternative solution. We then stopped using Sharethis on the clients site for a better option: the service_links module. After we configured the service_links module the performance was dramatically improved. This experience of sharing Drupal knowledge is an example of why Drupalcon's are so important.

The Sharethis/Addthis performance problem is it appends to every node and the caching strategies used by both providers is weak to say the least. Both are currently attempting to improve the leave of performance in this area so over time these issues should decline. The impact of these slow loading scripts is that the user is given feedback that the page is still loading and it reduces their web experience. Also, in certain cases it can result in additional jquery effects firing in a delayed manner. In the big picture Sharethis/Addthis and the service_links module seem to do the same thing but the main difference is service_links doesn't call out to a remote service. The service_links module simply generates links via the traditional hook_links, exposed by Drupal core. This means that all work is carried out on the webserver and all the benefits of Drupal's page cache can be realised for all anonymous users.

The down side of the service_links module is on the interface ... it doesn't do fancy ajax stuff. However, the key here is when you stay local you know you are going to get better performance, remote services may provide certain bells and whistles but you become beholden to potentially external factors. So only go remote if the client needs these features otherwise stay local.

5 Comments

I use service_links on a lot

I use service_links on a lot of my sites. Clean, efficient, and it works like a champ. Useful tip!

If one wants to use an

If one wants to use an external module, the "Add to Any" Drupal module has the "bells and whistles" that are light years ahead. Particularly the auto-ranking, the search, the email tab. Add This is hokey and Share This is horrendously slow but a little richer with features. Love Add to Any.

I've been working with

I've been working with ShareThis a lot lately, and the script running quite nicely. If you checkout the DRUPAL-6--1 branch (or 6.x-1.x-dev) of http://drupal.org/project/sharethis , you'll see that it uses jQuery.getScript(), as well as the Drupal.settings behaviors to load the external JavaScript. Works pretty nicely, but unfortunately still runs into some problems when the script is out of the head tag.

Any help on that would be much appreciated!

Awesome seeing you guys at DrupalCon! Can't wait for the next meet.

Here is another case where

Here is another case where the Diggthis brought a site to its knees because it uses a backend call over the network.

Read more at how relying connections third party servers can be detrimental performance.

My blog's homepage was

My blog's homepage was loading awfully slow. Today, I've removed addthis code and it loads quite fast compared with the previous speed. Now, I'm thinking to write just my piece of code for sharing buttons. It should be quite simple, I think - constructing several URLs for each of the targets you want to use for sharing. I'll try to do this tomorrow, hope it will work quite well and ligtning fast.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options