Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Problems? Is your data what you think it is?
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

So I've started with the existing Greasemonkey script to add AJAX voting to Perlmonks AJAX replacement for voting buttons and added the ability to lookup the new reputation using the XML version of the nodes. It submits once to vote and then a second time to retrieve the reputation of the node you just voted on. This is required because when casting a vote you have to pass the node_id of the page your are voting from. I'm sure that this could be gotten around somehow.

I then started comparing the characters returned for the XML requests versus the characters returned by processing the entire page, and the page load times (these are the only metrics i could think of to start with, hopefully someone has some better ideas?) So I tested with a node and found out how many characters where needed for each vote. On the node tested it cost about 6k characters for the AJAX vote (and two requests) and 66k characters to load the page. The page load time averages 3s and the 2 XML page load times averaged .3 seconds.

Without better metrics it appears that AJAX voting is cheaper as long as you are voting less than 10 times on a page. 10 ajax votes would cost 60k characters and 3 seconds, about the same as loading the entire page once. If the voting limitation is changed then the cost of AJAX votes could be cut in half, or even less if the request could specifiy it only wants the reputation XML.

I was hoping to find that this could significantly enhance server performance. I'm not sure I've found that, but i do beleive that if the average number of votes per page is low (say < 6) then this could result in a great improvment in perlmonks performance.

So is this something we want to look into supporting to some degree? I.e. have a greasemonkey plugin with special XML syntax, or even provide javascript that could be entered into the freenodelet? or is this performance increase insignificant?

I would be interested to see if there are other aspects that could benefit from some AJAX as either a freenodelet code or greasemonkey script. Please express your opinions!

Install - Sorry I couldn't figure out a proper bracket to do the job.


___________
Eric Hodges

In reply to Perlmonks AJAX Voting by eric256

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others browsing the Monastery: (10)
    As of 2014-04-16 10:30 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      April first is:







      Results (423 votes), past polls