Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Feb 2000
Posts: 4,625
Member
Member
Offline
Joined: Feb 2000
Posts: 4,625
sub KillServer {
#used for the announcements
my $StartDate = shift;
my $EndDate = shift;

#convert dates to Julian dates
my $StartMonth = substr($StartDate, 0, 2);
my $StartDay = substr($StartDate, 2, 2);
my $StartYear = substr($StartDate, 4, 4);
my $EndMonth = substr($EndDate, 0, 2);
my $EndDay = substr($EndDate, 2, 2);
my $EndYear = substr($EndDate, 4, 4);

------------------
UBBDEV Moderator
OCCUPATION: Programmer, webmaster.

Hack Developer of the Ultimate Bulletin Board. I am not an employee of Infopop

Due to time limitation, I do not offer support Via. E-mail. Please post on the forums.

Sincerely,
MasterMind

Sponsored Links
Joined: May 2000
Posts: 243
Member
Member
Offline
Joined: May 2000
Posts: 243
Actually, I think that is as small as it will get. Maybe Mark can work something up, but if so it's something I haven't learned yet.

------------------
Powered by ZCom Bulletin Boards

Joined: Oct 2000
Posts: 38
Member
Member
Offline
Joined: Oct 2000
Posts: 38
You can replace this:
my $StartDate = shift;
my $EndDate = shift;

With this:
my ($StartDate, $EndDate) = @_;

I don't know about the rest.

------------------
Wartortle

I'm supposed to put somthin here? wink


Wartortle

I'm supposed to put somthin here? wink
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
P.I.T.A. / Programmer
Offline
Joined: Sep 2000
Posts: 755
Whoops! How'd I miss this thread?? How's this for smaller? [Linked Image]

Code
code:

Time the original vs the smaller version:

Benchmark: timing 10000 iterations of Original, Smaller...
Original: 2 wallclock secs ( 2.66 usr + 0.00 sys = 2.66 CPU) @ 3753.75/s (n=10000)
Smaller: 1 wallclock secs ( 0.88 usr + 0.00 sys = 0.88 CPU) @ 11350.74/s (n=10000)

Remember, the CPU time is the important stat, not the wallclock seconds

[Linked Image]

--mark

This message has been edited by Mark Badolato on November 19, 2000 at 01:34 AM


"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
P.I.T.A. / Programmer
Offline
Joined: Sep 2000
Posts: 755
Aw hell, it can be dropped to about 0.55 CPU by changing to:

Code
code:

See, always something to tweak! [Linked Image]

New benchmark:

Benchmark: timing 10000 iterations of Original, Smaller...
Original: 3 wallclock secs ( 2.61 usr + 0.00 sys = 2.61 CPU) @ 3827.02/s (n=10000)
Smaller: 1 wallclock secs ( 0.54 usr + 0.00 sys = 0.54 CPU) @ 18552.88/s (n=10000)

--mark

This message has been edited by Mark Badolato on November 19, 2000 at 01:14 PM


"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
Sponsored Links
Joined: Sep 2000
Posts: 1,304
Addict
Addict
Offline
Joined: Sep 2000
Posts: 1,304
Where do you even edit this?

------------------
The Fusion of Goku & Trunks...GoTorankusuKu

Joined: May 2000
Posts: 243
Member
Member
Offline
Joined: May 2000
Posts: 243
damn, they weren't kidding when they said you learn something new everyday [Linked Image]

Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
P.I.T.A. / Programmer
Offline
Joined: Sep 2000
Posts: 755
Heh yup. Hell I still learn new perl stuff all the time too. The trick though is to keep on searching, and researching, and learning. Read everything you can, experiment, watch what the knowledgable people do etc.

It takes practice! The above code change I did compared to the original is like 89% less code, and runs 400% faster then the original. I didn't learn how to that kind of stuff in a day. It took lots of dedication to the craft, and lots of watching what the real Perl gurus. But who knows, some of the gurus could come along and shrink that even further...

I recommend that anyone who wants to get serious, get a newsreader, connect to Usenet and follow along at comp.lang.perl.misc (warning, do a LOT of lurking there before even thinking about posting. The group has no tolerence for newbies asking FAQ's or not doing basic research on their own). I can't tell you how much I've learned from reading that group daily.

--mark


"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
Joined: May 2000
Posts: 243
Member
Member
Offline
Joined: May 2000
Posts: 243
Quote
quote:
So Mark. Where can I get some of your scripts eh? [Linked Image]

------------------
Powered by ZCom Bulletin Boards

Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
P.I.T.A. / Programmer
Offline
Joined: Sep 2000
Posts: 755
Ya can't. I don't have any that are publicly released, save for a stupid clock script that i put on hotscripts and cgi-resources once just to see what kind of traffic the sites generate [Linked Image]

Someday when I actually have some of that free time thing I've heard so much about, I'd like to finish the UGB 2.0, which we was started back in april and hasn't been touched since July [Linked Image]

But, all of my other stuff has been private contract work, or my job.

--mark


"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
Sponsored Links
Joined: Aug 2000
Posts: 3,590
Moderator
Moderator
Offline
Joined: Aug 2000
Posts: 3,590
damn jobs

------------------
Da Wannabe Cannuck

:: Who is Andy?

Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
P.I.T.A. / Programmer
Offline
Joined: Sep 2000
Posts: 755
yeah i know huh? having to work to pay bills [Linked Image] [Linked Image]

--mark


"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan

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
AllenAyres
AllenAyres
Texas
Posts: 21,079
Joined: March 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
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,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)