phpbb/phpbb — pull request #2065 by prototech (2014-02-28 03:43:21+00:00)
Title: [ticket/12232] Remove excessive calls to sizeof() in assign_block_vars() method.

The size of the template block array is calculated within a foreach loop iterating through the array, which is unnecessary. It only needs to be done once. In a block of 1000 rows, this results in 500,500 calls ((1000 * 1001) / 2) to sizeof() in this location. With this change, that's reduced to 1000.

In the case of the ban page, there are three blocks assigned for each banned user... which means 1,501,500 calls to sizeof(). Fun.

http://tracker.phpbb.com/browse/PHPBB3-12232