• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item3844: Performance: Don't overuse object syntax

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine   Normal Closed   n/a  

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

TWiki:Main.HaraldJoerg pointed out that TWiki overuses the $object->method(). Since this type of call implies a lookup of the dynamic symbol table of the object class, it is not susceptible to optimisation by the perl compiler. Since such calls are only really necessary where method is overridden in a subclass, the syntax definitively should not be used for private methods, or for any methods on the singletons.

-- TWiki:Main/CrawfordCurrie - 05 Apr 2007

I have changed all private method calls to avoid the syntax; it has a small but measurable performance impact.

-- TWiki:Main/CrawfordCurrie - 05 Apr 2007

I went a step further and changed all calls to the singleton objects to avoid the object syntax. It makes TWiki 30% ..... slower :-/

Patch attached.

I hate perl!

CC

I've run out of things I wanted to try on this, so closing it.

CC

ItemTemplate
Summary Performance: Don't overuse object syntax
ReportedBy TWiki:Main.HaraldJoerg
Codebase

SVN Range TWiki-4.1.2, Tue, 03 Apr 2007, build 13257
AppliesTo Engine
Component

Priority Normal
CurrentState Closed
WaitingFor

Checkins TWikirev:13271
TargetRelease n/a
ReleasedIn

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatdif perfdiff.dif r1 manage 269.8 K 2007-04-07 - 11:07 CrawfordCurrie patch against 13298
Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2007-04-13 - CrawfordCurrie
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback