Project

General

Profile

Actions

Task #50484

closed

Generating URLs takes very long

Added by Norbert Sendetzky over 11 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Site Handling, Site Sets & Routing
Target version:
-
Start date:
2013-07-27
Due date:
% Done:

0%

Estimated time:
20.00 h
TYPO3 Version:
6.1
PHP Version:
5.3
Tags:
Complexity:
Sprint Focus:

Description

Hi all

We found out that generating simple URLs using $cObj->typoLink_URL() or $this->uriBuilder->uriFor() in ExtBase plug-ins take very long compared to other frameworks like Zend.

Time for creating 100 URLs without RealURL:
- standard URLs: 113.239050ms
- absolute URLs: 123.664141ms
- with CHash: 110.864878ms
- without CHash: 87.856054ms

Time for creating 100 URLs with RealURL:
- standard URLs: 194.674969ms
- absolute URLs: 205.719948ms
- with CHash: 193.242073ms
- without CHash: 168.409109ms

Even when disabling RealURL, more than 100ms are necessary to generate 100 URLs while the Zend Framework needs around 10ms to do the same. Usually, product lists in e-commerce sites generate a lot of similar URLs. Is there a possibility to speed up generating the URLs by using some sort of caching?

For testing, I've used a modified version of the efempty plugin and the relevant code is:

public function urlAction() {
$results = array();
$results[] = 'Time for creating 100 URLs:';

$start = microtime( true );
for( $i = 0; $i < 100; $i++ ) {
$this->uriBuilder->reset()->uriFor( 'url', array(), 'Start' );
}
$results[] = sprintf( '- standard URLs: %1$fms', ( microtime( true ) - $start ) * 1000 );
$start = microtime( true );
for( $i = 0; $i < 100; $i++ ) {
$this->uriBuilder->reset()->setCreateAbsoluteUri( true )->uriFor( 'url', array(), 'Start' );
}
$results[] = sprintf( '- absolute URLs: %1$fms', ( microtime( true ) - $start ) * 1000 );
$start = microtime( true );
for( $i = 0; $i < 100; $i++ ) {
$this->uriBuilder->reset()->setUseCacheHash( true )->uriFor( 'url', array(), 'Start' );
}
$results[] = sprintf( '- with CHash: %1$fms', ( microtime( true ) - $start ) * 1000 );
$start = microtime( true );
for( $i = 0; $i < 100; $i++ ) {
$this->uriBuilder->reset()->setUseCacheHash( false )->uriFor( 'url', array(), 'Start' );
}
$results[] = sprintf( '- without CHash: %1$fms', ( microtime( true ) - $start ) * 1000 );
return join( '&lt;br/&gt;', $results );
}

Best regards,

Norbert


Files

efempty_1.0.4.zip (57.6 KB) efempty_1.0.4.zip Norbert Sendetzky, 2013-07-27 14:09

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #49575: Split up typolink() functionality in multiple methodsClosed2013-07-02

Actions
Actions

Also available in: Atom PDF