TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 01-09-2008, 08:31 PM   #1 (permalink)
The Addict
Top Contributor Good Samaritan 
 
Join Date: Jan 2008
Location: USA
Posts: 217
Thanks: 16
RobertK is on a distinguished road
Bug Object methods suddenly lagging?

Hey all, I need to figure out a way to benchmark object methods and log them somehow. Maybe I have to create an object for this, I dunno. Perhaps I don't even need to do this, but am being dangerous somewhere in my coding.

I need your advice here.

I'm in the finalization stage of turning my hash() function algorithm enumerator (now PHL: the PHP Hash Library) into a fully object oriented library. The intent is for a modular object that you can use to give users the option to use alternate hashes for security during the install process. (Intelligently picking ones that are tough and fast on their server. Just use Hash() after install, not my objects.)

Only one problem:

Not long ago, and with my previous version even, I was getting speeds of roughly 130gb/sec throughput through the hash() function, but now it averages in the tens of MB/sec. I still get this old speed with the previous version. But now, after a number of supposedly trivial changes (ones I don't recall now) the page takes 5-7 times longer to load! This is from 0.8 seconds to roughly 5.3 seconds average. The previous version typically sits at 0.6-0.8 seconds, but the new hashes with each 3 times and used to hit 1 second generation time tops.

I cannot seem to pin down where the slowdown occurs, which is ticking me off. There are a good number of loops in my test page, but they're all lightweight. I suspect that somewhere inside my object(s) (there are 3) there may be a near infinite loop somewhere. Or I just have too many nested loops, though I find they're quite necessary.

What do you suggest? I have attached the source beta so that you can analyze it for yourself. I would have attached the log file(s) but I cannot find them; perhaps someone could help by telling me what to set in PHP.INI for a WAMP system. Any help is appreciated!

(Background colors won't make much sense so long as this issue persists I'm afraid. I had it just right, and was going to continue to tweak it.)

Addendum: Trying to shutdown Apache, it seems to be taking an inordinately long time. Almost 90 seconds, and I have an AMD X2 4800+. I'm looking into that, but I think it may return to this point if I'm doing something subtly wrong in my script. Restarting Apache yields no difference in page test speed, though Apache closes quickly again.
__________________
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning. - Rich Cook

Last edited by RobertK : 01-11-2008 at 02:40 PM.
RobertK is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 09:25 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design