Arrays size and memory
Posted: Wed Oct 12, 2011 8:46 pm
Hi,
i have an array that contains all games from db table (id, name, icon, teams, played, spent)
this array is not big, since data is small and less than 5/10 rows
after for each game i have a gametype (id, gameid, name, description, played, spent)
and also i have maps (id, gameid, gametypes, name, played, spent)
so right now im joinning results to just 1 array
gametypes and maps will join to game array like that: game[0]['gametypes'] = array(...); and game[0]['maps'] = array(...);
theres the code
for for multi dimension array games i will join another 2 multi dimension array
gametypes have about 5/10 in max rows but have description text, not big but its html
maps can be about 20/30 in max
so i want to ask if that affect performance or speed and if is different if i do:
so having 3 diferente array variables will be better to server performance and speed? or it all goes to same?
thanks
i have an array that contains all games from db table (id, name, icon, teams, played, spent)
this array is not big, since data is small and less than 5/10 rows
after for each game i have a gametype (id, gameid, name, description, played, spent)
and also i have maps (id, gameid, gametypes, name, played, spent)
so right now im joinning results to just 1 array
gametypes and maps will join to game array like that: game[0]['gametypes'] = array(...); and game[0]['maps'] = array(...);
theres the code
Code: Select all
if($withGameTypes && !isset($game['gametypes']))
{
$game = self::joinGametypes($value);
}
if($withMaps && !isset($game['maps']))
{
$game = self::joinMaps($value, false);
}
return $game;
gametypes have about 5/10 in max rows but have description text, not big but its html
maps can be about 20/30 in max
so i want to ask if that affect performance or speed and if is different if i do:
Code: Select all
$game = Game::get(id);
$gametypes = Gametype::getForGame(id);
$maps = Map::getForGame(id);thanks