[TYPO3-dev] typoLink() further tuning

Vladimir Podkovanov admin at sitesfactory.ru
Mon Jul 6 01:45:25 CEST 2009


Vladimir Podkovanov wrote:
> Hi list!
> I want to add new feature to typolink in order to further improve
> performance.
> In real life it is quit often that typolink is being used to create 
> links to the same page where link located itself. It happens every time 
> when you have same PIDs for list view and single view for some plugin.
> To create such link back to the same page it is often used construction 
> like typolink.parameter.data = TSFE:id
> I propose to add keyword "self" to produce links to same page.
> 
> Benefits:
> 1) saves time on parsing and retrieving getText's TSFE:id
> 2) "self" keyword allows us to refactor typoLink() function in such way 
> that these links are not going through some checks like checking if the 
> page exists and is accessible (because it is the page being rendered 
> yet) it saves some function calls and processing here.
> 
> So with "self" some processing into typolinks can be skipped and 
> considering that page can contains tens or hundreds links it will 
> increase overall performance. Also it looks more neat ;)
> typolink.parameter = self   vs.   typolink.parameter.data = TSFE:id
> 

So to conclude our discussion, plan for new feature is
- add "this" as keyword to produce links to same page
- skip unneeded processing in typoLink() function (i.e. calling to 
getPage_noCheck(), getPage(), getMountPointInfo(), 
getClosestMPvalueForPage) if TSFE->id == typolink.parameter

I'll try to submit RFC with the patch soon.

-- 
-rgds-
Vladimir




More information about the TYPO3-dev mailing list