Hello,
I’ve been experiencing a major slow down while using OOP in php5. One class places data into a DATA array. Very simple. And second class takes that data puts it into a html table and makes a nice html page. What I have noticed is that a slow down happens if I have more then 10 or so items in my DATA array, also it only happens when the SECOND class is called, which loops through DATA array and puts the data into table. My main server cranks everything through pretty efficiently, but the experimental server has slow downs up to 1 minute. BTW I’m using XAMPP 1.4.13 for windows for the experimental server with PHP 5.0.4 and MySQL 4.1.11. Does anyone have any ideas? Anything would be helpful. Thanks.
while($row = current($data)) {
//get the data from $row and put it into table
//keep adding table to $mainString
next($data)
}
return $mainString;
There is truly nothing to it. A few javascript calls in the beginning. But just like you said, I think its a server issue. Not the code. If you have any ideas I will be have to investigate them. This a real problem for me, because I have to wait in "minutes" everytime I work on these files. Thank you for your time.
The slow down seems to happen when the second class is looking through the DATA array with if statements. Even though the search through the DATA array is N^2. It is very simple and only takes 2 seconds on 'good' server. It takes up to 2 second per row on the 'bad' server, thus taking it 1 minute to load.
EDIT: Note that the 'good' server has a slower CPU. Also on the 'bad' server, I'm monitoring the memory usage and it doesn't really go up or down. At first I thought it was a memory issue.
Bookmarks