CodeIgniter Forums
result vs result_array - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: result vs result_array (/showthread.php?tid=15065)



result vs result_array - El Forum - 01-25-2009

[eluser]Unknown[/eluser]
Which function is the most efficient when passing the data to a view, result() or result_array() ? I am assuming that result_array takes slightly longer because the data must be converted into an array first, I just want to make sure.


result vs result_array - El Forum - 01-25-2009

[eluser]Phil Sturgeon[/eluser]
Some benchmarks were done a little while ago showing that arrays are actually 0.002% faster or something silly like that, but it really doesn't make enough difference to worry about. Just pick whichever syntax you like the most.


result vs result_array - El Forum - 01-25-2009

[eluser]jalalski[/eluser]
I think it was between 0.002% and 0.0043% depending on the caching/hashing algorithm used. I know that if you have like a gazillion arrays to convert it can make a difference of quite a few millisecs and, hey, a millisec here, millisec there, soon your talking real time... Smile