<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Op 25-9-2012 23:57, Martin Scotta
      schreef:<br>
    </div>
    <blockquote
cite="mid:CA+tCNCU6u2S-73+2z4RN4kVEBrQeVEsLsSRR0Z7nEOE5+EsAJA@mail.gmail.com"
      type="cite">this works fine for me...<br>
      the trick is to process buckets 25 dates each time, and delaying
      the execution of the rest 10ms which gives some time to the
      browser to handle other threads.<br>
      <br>
      Not the best thing, best would be handle these manipulation at
      backend side.<br>
      <br>
      <span style="font-family:courier new,monospace">return function()
        {<br>
                var ageclass = /\\bage\\b/,<br>
                    dateclass = /\\bdate\\b/,<br>
                    nodes = document.getElementsByClassName ?
        document.getElementsByClassName('age')<br>
                                                            :
        document.getElementsByTagName('*'),<br>
                    length = nodes.length, i=0;<br>
                // delayed execution for responsiveness<br>
                !function  process() {<br>
                    // each time process only some dates<br>
                    for (var b = 0; b < 25; b++) {<br>
                        var node = nodes[i++];<br>
                        // we may destroy nodes as we process them<br>
                        if (node && node.textContent) {<br>
                            var classes = node.className;<br>
                            if (document.getElementsByClassName ||
        ageclass.test(classes)) {<br>
                                var agevalue = age(node.textContent);<br>
                                if (dateclass.test(classes)){<br>
                                    // We want both: date + (age)<br>
                                    node.textContent += '
        ('+agevalue+')';<br>
                                } else {<br>
                                    node.textContent = agevalue;<br>
                                }<br>
                            }<br>
                        }<br>
                    }<br>
                    if (i < length) setTimeout(process, 10);<br>
      </span></blockquote>
    <br>
    You can just use setTimeout(process, 0). This will allow other
    things to be handled before it continues, no need to make it wait
    10ms.<br>
    <br>
    Also I would think you should easily be able to increase the bucket
    size to say, a 1000 at a time.<br>
    <br>
    ~Laurens<br>
    <br>
  </body>
</html>