JQuery 1.4 beta and DataTables

JQuery 1.4 beta and DataTables

brilangbrilang Posts: 22Questions: 2Answers: 1
edited December 2009 in General
Has anyone tested DataTables under the JQuery 1.4 beta yet?

Replies

  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin
    Hi brilang,

    I've just tried DataTable 1.5.6 under jQuery 1.4 alpha 2, and it runs through the unit test suite without any problems. Interestingly 1.4 alpha 2 actually appears to be slightly slower than jQuery 1.3.2, since it took 188 seconds to complete the unit tests with 1.4 alpha 2 and 173 seconds to complete the run with 1.3.2. I'm sure they will shake this out before the full release though.

    Short answer: It works fine :-)

    Regards,
    Allan
  • brilangbrilang Posts: 22Questions: 2Answers: 1
    Thank you
  • MikeSMikeS Posts: 113Questions: 1Answers: 0
    edited January 2010
    Hi Allan,

    Have you had a chance to run the unit tests on the official jQuery 1.4 release? If so, what did it reveal regarding speed?

    Also, do you see any new changes or features in jQuery 1.4 that you can apply to improve datatables?

    Regards,
    Mike
  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin
    Hi Mike,

    The next release of DataTables will come with 1.4 included. The jQuery team have done a superb job with the 1.4 release - kudos to them, and it will certainly benefit DataTables in interaction terms. I've just run a few tests and it doesn't make a lot of different in terms of speed (<1% difference in Safari 4 - might be more in other browsers), but I think those with a large number of rows will see a large benefit from the addClass/removeClass changes that have been made (and also some changes in DataTables 1.6).

    Beyond the use of events, selectors and Ajax, there isn't a huge amount of jQuery used in DataTables (for example I use Node.removeChild, rather than $().remove() since it's faster for what DataTables is doing), so I don't think there will be many changes due to the new release - although obviously if there is a benefit to using something, then I'll use it!

    One of the really great things they have done is to include JSON validation - rather than just using eval(). That's going to be a huge benefit to DataTables since invalid json is one of the most common developer issues. There are a number of other things as well which will help, but I'm sorry to say that there won't be anything dramatic!

    Regards,
    Allan
  • MikeSMikeS Posts: 113Questions: 1Answers: 0
    Alan,

    You said "...there won't be anything dramatic!", but you'd also said "I think those with a large number of rows will see a large benefit...". If this is true, I think that's "dramatic" enough for me to upgrade. Is the addClass/removeClass changes that you mention something internal to the datatables core js or is it something that would benefit someone extending and/or modifying your stuff? I hope the former since I don't change or write any of my own plugins.

    Thanks for the update.

    Mike
  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin
    Hi Mike,

    Heh - yes I can see that the two phrases can be considered contradictory! What I meant by nothing too dramatic was, the 1.6 DataTables release isn't a large re-write of the internal storage or anything, so there isn't a 50% gain in speed or anything like that.

    There are two areas which benefit from a speed increase in DataTables 1.6:

    - Row classes (i.e. odd/even) - This used addClass/removeClass and could be quite slow with a lot of rows. Using some suggestions from this forum, I've implemented a new method which reduces the DOM interaction, thus giving a speed up, in the DataTables core. But even better is that jQuery 1.4 improves the addClass/removeClass speed - so we should see a benefit there! It will be more noticeable for longer table displays (like 100 rows on a page).

    - 'Sort classes' (the highlighted column which is being sorted on) use addClass/removeClass quite intensively, so we'll see a benefit there as well.

    There are a number of improvements in DataTables 1.6, mostly tidy up and common sense stuff, but it should be a fairly painless upgrade process. I'll write a note noting what might cause incompatibilities from 1.5.

    Regards,
    Allan
This discussion has been closed.