perfomance vs features [Solved]

perfomance vs features [Solved]

jp_noronhajp_noronha Posts: 59Questions: 0Answers: 0
edited September 2011 in General
Hi Alllan

I would like to know, if is there any difference, between a script made for perfomance or a script made for features.
in other word, are there any features that turned off show a boost in perfomance?

For example, in a table with more than 5000 rows i turned off sorting, paging and grouping features.
The general purpuse is to avoid memory consuption and not permit methods that take some time to return results and give a better experience to the user.

Replies

  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    Hi,

    Good question and the answer is yes, the more features you have enabled, the more processing that is required. By far the most intensive are sorting and filtering - paging have very little overhead due to how it is implemented in DataTables (in fact with deferred rendering paging can speed things up significantly when using an Ajax source). Sorting is intensive primarily before the sort is a reasonably complex process (particularly if you do multi-column sorting). If you do profiling on DataTables then you will frequently see that the sorting is the part which takes the longest - there are a few things that might be done to speed it up a bit, but they will require a fair bit of work in the core.

    Filtering is fairly intensive because of the string concentration and regular expressions that DataTables does - on every row. Not typically as bad as sorting, but still noticeable. Moreover, filtering needs to store the strings from the table in memory, so this can add a little bit to the memory usage of the table. It won't come close to doubling it, but it will add a little bit.

    If you disable these features then DataTables doesn't use them, thus saving you those clock cycles and memory.

    If memory is a significant issue for you (an embedded device for example) then you might want to look at modifying the source, and removing some code which you won't be using - for example if you don't plan to use state saving, you could remove the state saving code. However, I've used DataTables on a couple of embedded devices and it performs quite well from what I've seen.

    Allan
This discussion has been closed.