Improving the performance
| Project: | Drigg External Vote Button |
| Version: | 6.x-1.1 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | PGiro |
| Status: | active |
Jump to:
Currently, displaying the vote buttons is hard on the server and on the browser because
1) each button makes 3+N calls to the server (1 for the javascript, 1 for the loader, 1 for the loader image and N for the CSS and JS in your drupal site)
2) the loader spinner freezes in browsers because of the load
3) using setTimeout creates a new javascript environment for each one created
Here is what I have figured out:
1) The N calls to the server can be reduced or removed by either : including manually in your button template your required JS and CSS files or inlining them. However, for the sake of simplicity and example I will leave it the way it is in the default templates
2) The spinner I will remove in my next release because it is not helpful
3) I have found a way to use setInterval which seems to improve things a little (but needs confirmation). Unfortunatly, there is no other way to order the button display calls to the server.
I am trying to figure out a way by manipulating the IFRAME in javascript and by grouping all calls in a single call after the page has loaded but hits is proving extremely complicated and I have little time :(
I made a small test page with 6 buttons.
- Using the default button as is, I was getting over 142 requests downloading 830Kb of data in 11s
- By including on the CSS and JS for extra_voting_forms, I am down to 42 requests and 250KB of data in 6.69s
I think I'll just inline my CSS & JS...

#1
Call me a betatester and share that version. If it's faster, suuuper!
I am able to test it on a production site with around 600 visits a day. Is that good enough?
#2
Just wondring if there is any update on this?
#3
?
#4
Nope, sorry but I am busy in my real life (work + baby) and this is all done in my spare time
#5
Can I kick in $50 to help you free up some time? This module is important stuff.
Also, I have a site with 2600 uniques a day that I'd like to test this on. Thanks.
#6
@blfora: Got your email. Love your site ! But right now, my newborn baby and tired wife take precedence. Because I only work on D6, I wouldn't be able to go all the way to help you. You'll be better off putting this on oDesk...