Hack Name: UBB Clock Cycles
Description: Informs user how long UBB completes a specific script operation.
Version: 00.00.02beta
Download Link:
http://www.qasic.com/ubbhacks.html Update Info: To update just read the thread on how we've debugged this hack.
WARNING: There's a lot of tedious hacking to this hack - lots of Template hack. Not hard hacking but doing the same cut and paste over and over in different templates
Report bugs here.
qasic
YES!!!
I have been looking for something like this Q.. thank you very much... was talking to Mark about this last week... muy bueno!
I want to start bench-marking plain jane ubb's and see what different mods do for speed...
That is a lotta files to modify...:)
This would do well in a MHK setup...:)
nm, most of this can be handled with a "replace in files" in ultraedit...
LOL. Every tried Compact Headers/Footers Allen? That's the number reason why programs such as MHK/SHW exist
But yes, Replace in Files is an excellent trick. Too bad the Search in Files doesn't work on my Windows 2K for some reason
Oh well.
qasic
Whoa...that's a crap load of files. Is there a demo before I get myself into no man's land?
Hey GoTo... if Q doesn't have one... I'll put one up on our test forums...
Hey now, 36 files isn't *that* bad... er, is it?
And CFooters only mods FOUR files! I can do Compact Headers in like seven or eight minutes if I'm doing it locally. But then, I've done it a couple dozen times, so I'm good at it.
This seems like a cool hack, qasic. It will be going up on my test (soon to be public) site asap.
---Skorpion
[ May 14, 2001 12:31 AM: Message edited by: Skorpion ]
added to a test site with nothing but this and the wordlets_mods deal added... getting:
Processing Time: 0 wallclock secs ( 0.00 usr + 0.00 sys = 0.00 CPU)
for all pages, including search... there's only maybe 20 posts there, it should have some reading, shouldn't it?
hahaha ****! sorry but i am pissed! i was 2 steps away from finishinga multihack auto install when it crashed on me! oh well mabey another time
Allen, you have the Benchmark module installed? I heard that it was standard in every Perl installation but perhaps I'm wrong???
Thx.
q
GoTan, would a screenshot suffice? I've only got it running locally right now. I basically want to use it to test my own hacks to see how hard they are on the CPU.
qasic
Q, using the latest version of ActiveState Perl 5.6.1.626, which contains the Benchmark module:
http://aspn.activestate.com/ASPN/Reference/Products/ActivePerl/lib/Benchmark.html I might be reading it wrong, but I don't see where $ta or $tb are used in the examples....
ive got the benchmark module as well and get this on all pages:
Processing Time: 0 wallclock secs ( 0.00 usr + 0.00 sys = 0.00 CPU)
would the server being *Nix vs. Windows environment have anything to do with it?
[ May 14, 2001 01:53 PM: Message edited by: jordo ]
we are using Win2K/IIS5/AS Perl 5.6.1.626
Hmm,
Perhaps it's because of the - subroutine I put in. Allen, can you remove the $elapsed =~ s/(-)//g; routine from some templates and see if the seconds show some value (or in ubb_forum.cgi)? I probably think that's what is casuing the problems.
$ta and $tb are global variables which I've set up near the top of ultiamtebb.cgi.
qasic
Sorry folks, I had forgotten one line inside
ultimatebb.cgi.
Just right after the use vars statements inside that file add:
That should fix those stupid 0's.
Also the elapsed =~ s/(-)//g; should also be removed to give accurate results. (that is, if you have negative numbers, you have a super fast CPU .. hehe)
qasic
[ May 14, 2001 05:24 PM: Message edited by: qasic ]
yep, fixed it... muchas gracias...
thanks for the fix. this hack is something ive always wanted/needed, thanks for doing it.
Does the elapsed =~ s/(-)//g; have to be removed or is it unnecessary? I'm kind of confused on that.
Very cool hack Q
Let's put it this way. It'll be gone in the next beta version
q
OK I'm done removing that one line but I *think* I am getting strange results.
Are the clock cycles suppose to be negative?
This is what I am getting: Processing Time: -5 wallclock secs (-0.30 usr + -0.05 sys = -0.35 CPU)
Hmmm ... sometimes negative results are expected. However, locally, I always generate negative results so that's why I added that sub regexp in.
In that case, I may keep that in
Thx for being a Guinea Pig Gotan. Any more users willing to try?
qasic
Ehhh, I'll keep two version just in case something goes wrong again
[edit]
Oops, forgot smilies are handled differently :), and your welcome Q, I like beta testing even though it's a hassle
[/edit]
[ May 14, 2001 08:06 PM: Message edited by: GoTorankusuKu ]
ya mines usually around -0.25
I'll be trying this out on my test board, qasic. Not open to the public yet cuz it's still deep in development and I've only got one license, but it will be soon. I'll let you know if I have any problems with it, tho.
---Skorpion
Hey folks,
I found the reason why it was giving negative results. You have to switch the order of $ta and $tb.
So instead of:
my $elapsed = timestr((timediff($ta,$tb))); $elapsed =~ s/(-)//g;
you need:
my $elapsed = timestr((timediff($tb,$ta)));
I'll update the ZIP docs when I get some spare time.
qasic
Hey Q, about your new finding.
All I go to do is replace:
right?
Well I changed the line in all the files and no problems with the negatives so far. I'll keep you updated.
Code looks to be right. Just remember that sometimes it's Footer =~ s/...
qasic
Yeah I know, I used Ultra-Edit's replace function to replace all instances of:
with
Here's the updated text file I fixed in 5 seconds (damn I love Ultra-Edit :D)
Yep, I definetly second that.
v00.00.02beta is out. It incorporates all fixes mentioned in this thread up to this post.
qasic
Bug: In the PM (where the actual messages are/public_pm_list.pl) the was not processed. The source came out as:
[ May 18, 2001 08:44 PM: Message edited by: GoTorankusuKu ]
NICE job Qasic!!!
Thx Gotan. Here's the fix:
*******************
ubb_pm.cgi
*******************
# FIND:
$ThisHTML .= $Footer;
# ADD AFTER:
$tb = new Benchmark; my $elapsed = timestr((timediff($tb,$ta))); $ThisHTML =~ s//$elapsed/;
Text file updated.
qasic
What do I need to change for this to work with who's online? One of the lines of code that you have to edit at the beginning of these instructions is replaced by the who's online hack and i'm not good enough with cgi to figure out how to make the two work together
Which lines in specific?
qasic
I have who's online installed and I hadn't noticed a alteration issue?
Unless I missed something along the way- I installed this hack the other night, and every page works properly from what I have seen so far- including Who's Online.
Nice hack btw qasic- for some oddball sick sort of geeky fetish, I like to watch the box get benchmarked when I am wandering aimlessly through the forums...
Hey, long time no thread chat, but I need this file......it'll be a great addition to my test boards. If anyone could upload it?