Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jan 2001
Posts: 1,940
Q
qasic Offline OP
Developer
OP Offline
Developer
Q
Joined: Jan 2001
Posts: 1,940
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

Sponsored Links
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
Offline
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
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...


- Allen wavey
- What Drives You?
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
Offline
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
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...


- Allen wavey
- What Drives You?
Joined: Jan 2001
Posts: 1,940
Q
qasic Offline OP
Developer
OP Offline
Developer
Q
Joined: Jan 2001
Posts: 1,940
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

Joined: Sep 2000
Posts: 1,304
G
Addict
Offline
Addict
G
Joined: Sep 2000
Posts: 1,304
Whoa...that's a crap load of files. Is there a demo before I get myself into no man's land?

Sponsored Links
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
Offline
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Hey GoTo... if Q doesn't have one... I'll put one up on our test forums...


- Allen wavey
- What Drives You?
Joined: Mar 2000
Posts: 3,594
J
Moderator / Template Diva
Offline
Moderator / Template Diva
J
Joined: Mar 2000
Posts: 3,594
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 ]


Don't put that signature in your mouth! You don't know where it's been!
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
Offline
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
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?


- Allen wavey
- What Drives You?
Joined: Mar 2001
Posts: 318
M
Member
Offline
Member
M
Joined: Mar 2001
Posts: 318
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

Joined: Jan 2001
Posts: 1,940
Q
qasic Offline OP
Developer
OP Offline
Developer
Q
Joined: Jan 2001
Posts: 1,940
Allen, you have the Benchmark module installed? I heard that it was standard in every Perl installation but perhaps I'm wrong???

Thx.

q

Sponsored Links
Joined: Jan 2001
Posts: 1,940
Q
qasic Offline OP
Developer
OP Offline
Developer
Q
Joined: Jan 2001
Posts: 1,940
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

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
Offline
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
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....


- Allen wavey
- What Drives You?
Joined: Aug 2000
Posts: 874
J
Moderator / Developer
Offline
Moderator / Developer
J
Joined: Aug 2000
Posts: 874
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 ]

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
Offline
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
we are using Win2K/IIS5/AS Perl 5.6.1.626


- Allen wavey
- What Drives You?
Joined: Jan 2001
Posts: 1,940
Q
qasic Offline OP
Developer
OP Offline
Developer
Q
Joined: Jan 2001
Posts: 1,940
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

Joined: Jan 2001
Posts: 1,940
Q
qasic Offline OP
Developer
OP Offline
Developer
Q
Joined: Jan 2001
Posts: 1,940
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 ]

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
Offline
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
yep, fixed it... muchas gracias...


- Allen wavey
- What Drives You?
Joined: Aug 2000
Posts: 874
J
Moderator / Developer
Offline
Moderator / Developer
J
Joined: Aug 2000
Posts: 874
thanks for the fix. this hack is something ive always wanted/needed, thanks for doing it.

Joined: Sep 2000
Posts: 1,304
G
Addict
Offline
Addict
G
Joined: Sep 2000
Posts: 1,304
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

Joined: Jan 2001
Posts: 1,940
Q
qasic Offline OP
Developer
OP Offline
Developer
Q
Joined: Jan 2001
Posts: 1,940
Let's put it this way. It'll be gone in the next beta version wink

q

Joined: Sep 2000
Posts: 1,304
G
Addict
Offline
Addict
G
Joined: Sep 2000
Posts: 1,304
LOL, here I go again...

Joined: Sep 2000
Posts: 1,304
G
Addict
Offline
Addict
G
Joined: Sep 2000
Posts: 1,304
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)

Joined: Jan 2001
Posts: 1,940
Q
qasic Offline OP
Developer
OP Offline
Developer
Q
Joined: Jan 2001
Posts: 1,940
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

Joined: Sep 2000
Posts: 1,304
G
Addict
Offline
Addict
G
Joined: Sep 2000
Posts: 1,304
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 ]

Joined: Aug 2000
Posts: 874
J
Moderator / Developer
Offline
Moderator / Developer
J
Joined: Aug 2000
Posts: 874
ya mines usually around -0.25

Joined: Mar 2000
Posts: 3,594
J
Moderator / Template Diva
Offline
Moderator / Template Diva
J
Joined: Mar 2000
Posts: 3,594
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


Don't put that signature in your mouth! You don't know where it's been!
Joined: Jan 2001
Posts: 1,940
Q
qasic Offline OP
Developer
OP Offline
Developer
Q
Joined: Jan 2001
Posts: 1,940
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

Joined: Sep 2000
Posts: 1,304
G
Addict
Offline
Addict
G
Joined: Sep 2000
Posts: 1,304
Hey Q, about your new finding.

All I go to do is replace:

Code
code:

Code
code:

right?

Joined: Sep 2000
Posts: 1,304
G
Addict
Offline
Addict
G
Joined: Sep 2000
Posts: 1,304
Well I changed the line in all the files and no problems with the negatives so far. I'll keep you updated.

Joined: Jan 2001
Posts: 1,940
Q
qasic Offline OP
Developer
OP Offline
Developer
Q
Joined: Jan 2001
Posts: 1,940
Code looks to be right. Just remember that sometimes it's Footer =~ s/...

qasic

Joined: Sep 2000
Posts: 1,304
G
Addict
Offline
Addict
G
Joined: Sep 2000
Posts: 1,304
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)

Joined: Jan 2001
Posts: 1,940
Q
qasic Offline OP
Developer
OP Offline
Developer
Q
Joined: Jan 2001
Posts: 1,940
Yep, I definetly second that.

v00.00.02beta is out. It incorporates all fixes mentioned in this thread up to this post.

qasic

Joined: Sep 2000
Posts: 1,304
G
Addict
Offline
Addict
G
Joined: Sep 2000
Posts: 1,304
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 ]

Joined: Feb 2000
Posts: 4,625
G
Member
Offline
Member
G
Joined: Feb 2000
Posts: 4,625
NICE job Qasic!!! laugh

Joined: Jan 2001
Posts: 1,940
Q
qasic Offline OP
Developer
OP Offline
Developer
Q
Joined: Jan 2001
Posts: 1,940
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

Joined: Mar 2001
Posts: 21
H
Junior Member
Offline
Junior Member
H
Joined: Mar 2001
Posts: 21
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

Joined: Jan 2001
Posts: 1,940
Q
qasic Offline OP
Developer
OP Offline
Developer
Q
Joined: Jan 2001
Posts: 1,940
Which lines in specific?

qasic

Joined: Sep 2000
Posts: 67
J
Member
Offline
Member
J
Joined: Sep 2000
Posts: 67
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...

Joined: Dec 2001
Posts: 57
C
Member
Offline
Member
C
Joined: Dec 2001
Posts: 57
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?


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Posts: 70
Joined: January 2007
Forum Statistics
Forums63
Topics37,569
Posts293,914
Members13,847
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,829
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 81
Gizmo 20
Brett 7
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2022 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Snapshot build 20220917)