php forum
php mysql forum
php mysql smarty
 
Topic Options
#103561 - 03/01/02 03:29 PM Optimizing a sub...
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25580
Loc: Texas
How would I go about optimizing this:

http://www.ubbdev.com/db/uploads/pagination_621.txt

If you have time can you tell me the principals behind making the changes?
_________________________
- Allen wavey
- What Drives You?

Top
#103562 - 03/01/02 04:20 PM Re: Optimizing a sub...
Charles Capps Offline
Admin Emeritus

Registered: 01/09/00
Posts: 5438
Loc: Lynnwood, WA
I'm not sure what can be done to speed it up... the best thing to do is just tinker with it as much as you can, trying different ideas, etc...

Check out the Benchmark module:

http://www.perldoc.com/perl5.6.1/lib/Benchmark.html
_________________________
UBB.classic: Love it or hate it, it was mine.

Top
#103563 - 03/01/02 04:24 PM Re: Optimizing a sub...
jordo Offline
Moderator / Developer

Registered: 08/05/00
Posts: 830
CC - out of curiousity, if you know O() notation, have you ever found it usefull with perl?
_________________________
jordo

Top
#103564 - 03/01/02 08:12 PM Re: Optimizing a sub...
Dave_L Offline
Member

Registered: 08/16/00
Posts: 356
Loc: Virginia, USA
It's hard to read due to the inconsistent indentation, but it looks like a lot of common expressions could be moved outside of the loops.

Also, according to Programming Perl (3rd Ed., chap 24), using join is more efficient than a series of string concatenations.

Top
#103565 - 03/02/02 10:24 AM Re: Optimizing a sub...
Mark Badolato Offline
P.I.T.A. / Programmer

Registered: 09/08/00
Posts: 836
Loc: Land O' Cactus
</font><blockquote><font size="1" face="Verdana, Helvetica, sans-serif">quote:</font><hr /><font size="2" face="Verdana, Helvetica, sans-serif">Originally posted by jordo:
CC - out of curiousity, if you know O() notation, have you ever found it usefull with perl?</font><hr /></blockquote><font size="2" face="Verdana, Helvetica, sans-serif">O notation is essentially a way of representing execution times/speeds for an algorithm. An algorithm can be represented in any languague [in some more effectivly than others], thus it's completely independant of relating it to perl, C, Java, etc. In other words, it's always useful when you're dealing with algorithms

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

Top
#103566 - 03/02/02 04:36 PM Re: Optimizing a sub...
jordo Offline
Moderator / Developer

Registered: 08/05/00
Posts: 830
yeah i know i was just curious whether they use it when developing ubb or whether the use Benchmark modules more heavily. smile
_________________________
jordo

Top
#103567 - 03/04/02 01:51 PM Re: Optimizing a sub...
Charles Capps Offline
Admin Emeritus

Registered: 01/09/00
Posts: 5438
Loc: Lynnwood, WA
We don't use it unless we're not getting acceptable performance...
_________________________
UBB.classic: Love it or hate it, it was mine.

Top
#103568 - 03/10/02 06:33 AM Re: Optimizing a sub...
Mystik Gotan Offline
Member

Registered: 12/20/01
Posts: 49
Loc: The Netherlands
Split the variables earlier?
_________________________
No images accepted anymore

Top



Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks