really slow - deferRender+ column.render with array of objects - checking if people get it to work

really slow - deferRender+ column.render with array of objects - checking if people get it to work

bflbfl Posts: 26Questions: 7Answers: 1
edited February 2015 in Free community support

Hello

this is datatables 1.10.5

I've got a big array of javascript objects of the form [{'thing':obj}] being set to the datatable's 'data' property, and using deferRender is still pretty slow. I am using column.render for each column, with each column having column.data='thing', as I pull out/massage different parts of the object for each column.

I'm still messing with this, but wondered if anyone else has gotten a nicely performing deferRender to work for a very large array of objects.

thanks

This question has an accepted answers - jump to answer

Answers

  • bflbfl Posts: 26Questions: 7Answers: 1

    also wanted to add - it seems to be calling the render callback for ALL entries of the array, whether or not they are visible, which seems like deferRender isn't even being used

  • bflbfl Posts: 26Questions: 7Answers: 1

    ok - after looking at this a little, it might be because jquery.Extend is being called on the settings with a deep copy, and my objects in the array have a deepish structure

  • bflbfl Posts: 26Questions: 7Answers: 1

    whoa - that was it. I tried just using an array of the ids as datasource and look things up in the render method to find the object and it's very fast

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    Hi,

    Good to hear you've got this fixed and running smoothly now.

    Why was the settings object being extended? Was that somewhere in DataTables?

    Allan

  • bflbfl Posts: 26Questions: 7Answers: 1

    Yes it was in datatables . It's not in front of me atm but as part of init it does the extend

  • bflbfl Posts: 26Questions: 7Answers: 1
  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin
    Answer ✓

    Hi,

    I've just added a comment to your blog post on this topic - this very certainly is a bug in DataTables! For the benefit of anyone else who reads this, this is a repeat (and slightly revised to make sense here) of my comments from @bfl's blog:

    DataTables actually implements its own extend method to stop the need of deep cloning the data property. I "got away" with it was it was, as the clone was actually being overwritten later on - so in fact the clone was being done with absolutely no benefit...

    I've just committed a fix which will be in DataTables 1.10.6 and is now in the nightly if you fancy trying it immediately :-).

    Thanks for finding this error and letting me know about it!

    Allan

This discussion has been closed.