Page 2 of 2
Posted: Mon Jul 10, 2006 11:11 pm
by AKA Panama Jack
arborint wrote:First let me specifically address this comment. You need to remember that "just including a php file" is often slower than reading in a data file and parsing it. PHP's include parses the file as well.
Actually it isn't. Parsing an ini file is still slower than loading a PHP file. It's never OFTEN slower to load a PHP file but it is going to always be slower to parse an ini file. It may SEEM faster but in real world stress tests parsing is always slower than just loading a php file that has just variable in it.
Posted: Tue Jul 11, 2006 12:24 am
by Christopher
AKA Panama Jack wrote:Actually it isn't. Parsing an ini file is still slower than loading a PHP file. It's never OFTEN slower to load a PHP file but it is going to always be slower to parse an ini file. It may SEEM faster but in real world stress tests parsing is always slower than just loading a php file that has just variable in it.
Ok ... let me get this straight ... you are saying that is it
always slower to parse an INI file than to parse a PHP file? Any size? Any kind of data? Always? Do you have benchmarks to back that up?
Posted: Tue Jul 11, 2006 2:05 am
by AKA Panama Jack
It depends upon what is in the ini file and what is in the PHP file.
Parsing an ini file that contains something like this...
Code: Select all
game_name = "Alien Assault Traders"
server_closed = 1
account_creation_closed = 1
tournament_setup_access = 0
player_limit = 10
will take longer than using an INCLUDE statement to load a php file that contains...
Code: Select all
<?php
$game_name = "Alien Assault Traders";
$server_closed = 1;
$account_creation_closed = 1;
$tournament_setup_access = 0;
$player_limit = 10;
?>
The code that will loop through the data from the ini file to process it into variables will take far longer than a straight include of a php file that is only variables.
I feel the need...
Posted: Tue Jul 11, 2006 4:15 am
by Yossarian
Sorry, I posted a solution that provides a quick and easy solution, not a
fast one.
