Blurb of the Day: Datatable/Dataview search. Find vs Rowfilter vs Select vs Linq

So at my job i needed to update some code. The way we accessed the old code had to change since i changed some of the underlying specs of the data that i was using. In this change i decided to use a rowfilter. I had used row filter in the past and had had good results.

Well this time it wasnt the same. Our interface does constant checks on data as soon as it is entered so everytime a char is entered a check takes place to see if the information is valid. if it is it returns the accompanying data, if not then it returns as invalid. In testing one of the users noticed that there was a small lag during entry. now grated it was a small hesitation but one that could potientally lead to a bigger problem later down the line.

As i did my investigating it turned out that the culperate was the rowfilter on my dataview. since all of my data was in memery i ran a few speed test to see the differences between the rowfilter, find, select, and linq. The results were unexpected. In running 10000 records from memory these are the results:

Method          Time
———-          ———-
RowFilter        113 Secords
Linq                 0.008 Seconds
FindRow         0.003 Seconds
Select             0.257 Seoncds

Looking at the results i was shocked to see the rowfilter took so long. so if your using any kind of datatable or dataview i would highly recommend staying away from rowfilter in time sensitive real time validation in applications. If anyone has anything they would like to add please let me know in the comment section.

This entry was posted in Uncategorized and tagged , , , , , , , . Bookmark the permalink.

4 Responses to Blurb of the Day: Datatable/Dataview search. Find vs Rowfilter vs Select vs Linq

Leave a Reply

Your email address will not be published.