UBB.Dev
Posted By: qasic [6.0x] UBB Clock Cycles v00.00.002beta - 05/14/2001 6:26 AM
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 laugh

Report bugs here.

qasic
Posted By: AllenAyres Re: [6.0x] UBB Clock Cycles v00.00.002beta - 05/14/2001 6:32 AM
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...
Posted By: AllenAyres Re: [6.0x] UBB Clock Cycles v00.00.002beta - 05/14/2001 6:35 AM
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...
Posted By: qasic Re: [6.0x] UBB Clock Cycles v00.00.002beta - 05/14/2001 6:48 AM
LOL. Every tried Compact Headers/Footers Allen? That's the number reason why programs such as MHK/SHW exist wink

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 frown

Oh well.

qasic
Whoa...that's a crap load of files. Is there a demo before I get myself into no man's land?
Posted By: AllenAyres Re: [6.0x] UBB Clock Cycles v00.00.002beta - 05/14/2001 7:09 AM
Hey GoTo... if Q doesn't have one... I'll put one up on our test forums...
Posted By: Jamin Re: [6.0x] UBB Clock Cycles v00.00.002beta - 05/14/2001 7:29 AM
Hey now, 36 files isn't *that* bad... er, is it? smile 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. smile

---Skorpion

[ May 14, 2001 12:31 AM: Message edited by: Skorpion ]
Posted By: AllenAyres Re: [6.0x] UBB Clock Cycles v00.00.002beta - 05/14/2001 8:19 AM
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?
Posted By: Mr.Clean Re: [6.0x] UBB Clock Cycles v00.00.002beta - 05/14/2001 8:37 AM
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
Posted By: qasic Re: [6.0x] UBB Clock Cycles v00.00.002beta - 05/14/2001 6:56 PM
Allen, you have the Benchmark module installed? I heard that it was standard in every Perl installation but perhaps I'm wrong???

Thx.

q
Posted By: qasic Re: [6.0x] UBB Clock Cycles v00.00.002beta - 05/14/2001 6:58 PM
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
Posted By: AllenAyres Re: [6.0x] UBB Clock Cycles v00.00.002beta - 05/14/2001 8:33 PM
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....
Posted By: jordo Re: [6.0x] UBB Clock Cycles v00.00.002beta - 05/14/2001 8:51 PM
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 ]
Posted By: AllenAyres Re: [6.0x] UBB Clock Cycles v00.00.002beta - 05/14/2001 9:53 PM
we are using Win2K/IIS5/AS Perl 5.6.1.626
Posted By: qasic Re: [6.0x] UBB Clock Cycles v00.00.002beta - 05/15/2001 12:00 AM
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
Posted By: qasic Re: [6.0x] UBB Clock Cycles v00.00.002beta - 05/15/2001 12:22 AM
Sorry folks, I had forgotten one line inside ultimatebb.cgi.

Just right after the use vars statements inside that file add:

Code
code:

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 ]
Posted By: AllenAyres Re: [6.0x] UBB Clock Cycles v00.00.002beta - 05/15/2001 12:36 AM
yep, fixed it... muchas gracias...
Posted By: jordo Re: [6.0x] UBB Clock Cycles v00.00.002beta - 05/15/2001 1:06 AM
thanks for the fix. this hack is something ive always wanted/needed, thanks for doing it.
Quote
quote:
Does the elapsed =~ s/(-)//g; have to be removed or is it unnecessary? I'm kind of confused on that. Very cool hack Q wink
Posted By: qasic Re: [6.0x] UBB Clock Cycles v00.00.002beta - 05/15/2001 2:29 AM
Let's put it this way. It'll be gone in the next beta version wink

q
LOL, here I go again...
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)
Posted By: qasic Re: [6.0x] UBB Clock Cycles v00.00.002beta - 05/15/2001 2:56 AM
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 smile 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 tipsy

[edit]
Oops, forgot smilies are handled differently :), and your welcome Q, I like beta testing even though it's a hassle laugh[/edit]

[ May 14, 2001 08:06 PM: Message edited by: GoTorankusuKu ]
Posted By: jordo Re: [6.0x] UBB Clock Cycles v00.00.002beta - 05/15/2001 3:24 AM
ya mines usually around -0.25
Posted By: Jamin Re: [6.0x] UBB Clock Cycles v00.00.002beta - 05/15/2001 4:23 AM
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
Posted By: qasic Re: [6.0x] UBB Clock Cycles v00.00.002beta - 05/16/2001 4:55 AM
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:

Code
code:

Code
code:

right?
Well I changed the line in all the files and no problems with the negatives so far. I'll keep you updated.
Posted By: qasic Re: [6.0x] UBB Clock Cycles v00.00.002beta - 05/16/2001 6:02 AM
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:

Code
code:
with
Code
code:

Here's the updated text file I fixed in 5 seconds (damn I love Ultra-Edit :D)
Posted By: qasic Re: [6.0x] UBB Clock Cycles v00.00.002beta - 05/16/2001 7:22 AM
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:

Code
code:

[ May 18, 2001 08:44 PM: Message edited by: GoTorankusuKu ]
Posted By: Greg Hard Re: [6.0x] UBB Clock Cycles v00.00.002beta - 05/19/2001 5:50 AM
NICE job Qasic!!! laugh
Posted By: qasic Re: [6.0x] UBB Clock Cycles v00.00.002beta - 05/20/2001 5:45 AM
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 smile
Posted By: qasic Re: [6.0x] UBB Clock Cycles v00.00.002beta - 06/25/2001 12:19 AM
Which lines in specific?

qasic
Posted By: jlaine Re: [6.0x] UBB Clock Cycles v00.00.002beta - 06/25/2001 8:59 PM
Quote
quote:
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...
Posted By: CNA2 Re: [6.0x] UBB Clock Cycles v00.00.002beta - 02/09/2002 3:01 PM
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?
© UBB.Developers