Welcome Guest, Not a member yet? Register   Sign In
CI-based Web Sites Performance
#39

[eluser]Michael Wales[/eluser]
The reason he chose to move the result_array() call outside of the loop is because PHP runs foreach conditions upon every loop. A call to a function is slightly worse, performance wise, than a variable retrieval.

So, if a function call takes 1ms longer than a variable call, you can definitely see the benefits across 20-30 items you are looping.

I would assume a call to _fetch_assoc would render similar results. The speeds would be comparable to the call to result_array() but you will always be faster references the variable rather than a function call.


Messages In This Thread
CI-based Web Sites Performance - by El Forum - 02-03-2008, 07:15 AM
CI-based Web Sites Performance - by El Forum - 02-03-2008, 11:22 AM
CI-based Web Sites Performance - by El Forum - 02-03-2008, 02:01 PM
CI-based Web Sites Performance - by El Forum - 02-03-2008, 03:09 PM
CI-based Web Sites Performance - by El Forum - 02-03-2008, 04:54 PM
CI-based Web Sites Performance - by El Forum - 02-03-2008, 06:23 PM
CI-based Web Sites Performance - by El Forum - 02-03-2008, 08:33 PM
CI-based Web Sites Performance - by El Forum - 02-03-2008, 10:27 PM
CI-based Web Sites Performance - by El Forum - 02-04-2008, 02:44 AM
CI-based Web Sites Performance - by El Forum - 02-04-2008, 03:42 AM
CI-based Web Sites Performance - by El Forum - 02-04-2008, 08:43 AM
CI-based Web Sites Performance - by El Forum - 02-04-2008, 04:19 PM
CI-based Web Sites Performance - by El Forum - 02-04-2008, 04:54 PM
CI-based Web Sites Performance - by El Forum - 02-04-2008, 06:42 PM
CI-based Web Sites Performance - by El Forum - 02-04-2008, 09:38 PM
CI-based Web Sites Performance - by El Forum - 02-09-2008, 06:10 AM
CI-based Web Sites Performance - by El Forum - 02-09-2008, 01:51 PM
CI-based Web Sites Performance - by El Forum - 02-09-2008, 02:11 PM
CI-based Web Sites Performance - by El Forum - 02-09-2008, 03:55 PM
CI-based Web Sites Performance - by El Forum - 02-09-2008, 04:28 PM
CI-based Web Sites Performance - by El Forum - 02-09-2008, 08:21 PM
CI-based Web Sites Performance - by El Forum - 02-10-2008, 06:41 AM
CI-based Web Sites Performance - by El Forum - 02-10-2008, 04:44 PM
CI-based Web Sites Performance - by El Forum - 02-10-2008, 10:10 PM
CI-based Web Sites Performance - by El Forum - 02-11-2008, 03:37 PM
CI-based Web Sites Performance - by El Forum - 02-12-2008, 09:16 AM
CI-based Web Sites Performance - by El Forum - 02-12-2008, 09:26 AM
CI-based Web Sites Performance - by El Forum - 02-12-2008, 10:02 AM
CI-based Web Sites Performance - by El Forum - 02-12-2008, 01:51 PM
CI-based Web Sites Performance - by El Forum - 02-12-2008, 02:01 PM
CI-based Web Sites Performance - by El Forum - 02-12-2008, 02:34 PM
CI-based Web Sites Performance - by El Forum - 02-13-2008, 03:35 AM
CI-based Web Sites Performance - by El Forum - 02-13-2008, 05:14 AM
CI-based Web Sites Performance - by El Forum - 02-13-2008, 07:44 AM
CI-based Web Sites Performance - by El Forum - 02-13-2008, 08:53 AM
CI-based Web Sites Performance - by El Forum - 02-13-2008, 09:49 AM
CI-based Web Sites Performance - by El Forum - 02-13-2008, 12:38 PM
CI-based Web Sites Performance - by El Forum - 02-13-2008, 01:21 PM
CI-based Web Sites Performance - by El Forum - 02-13-2008, 01:24 PM
CI-based Web Sites Performance - by El Forum - 02-13-2008, 01:32 PM
CI-based Web Sites Performance - by El Forum - 02-13-2008, 02:57 PM
CI-based Web Sites Performance - by El Forum - 02-13-2008, 08:03 PM
CI-based Web Sites Performance - by El Forum - 03-16-2008, 05:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB