Monday, February 9, 2009

String Comparision

While executing a code i realized it was taking the DataGrid around 5 seconds to show the results of the filteration, the code written was simple, where in a string was provided thru the combobox and the filter used the string to filterout the list.

On investigation I found that the problem was not with the actionscript or Flex component e.g. Datagrid / AdvancedDataGrid but the problem was with String comparision, I am not sure why but out of the 5 secs the entire logic was taking more than 4 sec. to execute the string comparision,

After changing the logic from String to Int it was found to complete teh entire operation in less than 1 sec !!!!

So .... if you are using a string comparision in some loop ... esp with huge database like couple of thousands of rows, Avoid matching the String and use int.

No comments:

Post a Comment