Project

General

Profile

Actions

Bug #43540

closed

Task #52304: Performance issues

TS is fetched from cache incorrectly sometimes

Added by Dmitry Dulepov over 11 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Category:
TypoScript
Target version:
-
Start date:
2012-12-03
Due date:
% Done:

100%

Estimated time:
8.00 h
TYPO3 Version:
6.0
PHP Version:
Tags:
Complexity:
hard
Is Regression:
No
Sprint Focus:

Description

If $GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_constants'] or $GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_setup'] are set in the Install tool, cached TS will not be found in cache. This would result in TS parsing every time when there are USER_INT objects on the page. Generally it will slow down the page with USER_INT objects by at least 300% comparing to the non-cached version.

More information

When template parser processes the TS, it makes a hash to load a cached version of TS:

$this->runThroughTemplates($theRootLine);
...
$rowSumHash = md5('ROWSUM:' . serialize($this->rowSum));
$result = \TYPO3\CMS\Frontend\Page\PageRepository::getHash($rowSumHash);

There TS can be fetched from the cache. If nothing is returned, the TS is parsed and stored into the cache:

$this->generateConfig();
...
$rowSumHash = md5('ROWSUM:' . serialize($this->rowSum));
\TYPO3\CMS\Frontend\Page\PageRepository::storeHash($rowSumHash, serialize($cc['all']), 'TMPL_CONDITIONS_ALL');

Function generateConfig() prepends values from the above-mentioned variables before processing the data. The earlier called function runThroughtTemplates() does not do that. If the variables are empty, it does not make any difference and everything is cached. But if those variables are not empty (even if there is a single space), the $this->rowSum will be different in two quoted code extracts above. Thus TS will be stored with one hash value and the next request will try to retrieve it with another hash value. This means that cached TS will never be retrieved and will be always parsed.

We were able to decrease page generation from 2.88s to 0.8s by fixing the issue. 2 seconds make a huge difference in speed and load of the web server.


Related issues 1 (0 open1 closed)

Blocks TYPO3 Core - Bug #53352: Template Analyzer produces wrong resultsClosed2013-11-05

Actions
Actions #1

Updated by Dmitry Dulepov over 11 years ago

Should be read: "...comparing to the cached version".

Actions #2

Updated by Gerrit Code Review over 11 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16939

Actions #3

Updated by Gerrit Code Review over 11 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16939

Actions #4

Updated by Gerrit Code Review about 11 years ago

Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/18056

Actions #5

Updated by Dmitry Dulepov about 11 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 10 to 100
Actions #6

Updated by Gerrit Code Review about 11 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at https://review.typo3.org/18059

Actions #7

Updated by Gerrit Code Review about 11 years ago

Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at https://review.typo3.org/18061

Actions #8

Updated by Gerrit Code Review about 11 years ago

Patch set 2 for branch TYPO3_4-7 has been pushed to the review server.
It is available at https://review.typo3.org/18059

Actions #9

Updated by Gerrit Code Review about 11 years ago

Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at https://review.typo3.org/18062

Actions #10

Updated by Gerrit Code Review about 11 years ago

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18072

Actions #11

Updated by Gerrit Code Review about 11 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18072

Actions #12

Updated by Gerrit Code Review about 11 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18072

Actions #13

Updated by Gerrit Code Review about 11 years ago

Patch set 1 for branch master_new has been pushed to the review server.
It is available at https://review.typo3.org/18621

Actions #14

Updated by Gerrit Code Review about 11 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18072

Actions #15

Updated by Gerrit Code Review almost 11 years ago

Patch set 5 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18072

Actions #16

Updated by Markus Klein over 10 years ago

  • Parent task set to #52338
  • Is Regression set to No
Actions #17

Updated by Markus Klein over 10 years ago

  • Parent task changed from #52338 to #52304
Actions #18

Updated by Kasper Ligaard over 10 years ago

This solves the problem described in this thread: http://forum.typo3.org/index.php/m/695487/#page_top

Actions #19

Updated by Gerrit Code Review over 10 years ago

Patch set 6 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18072

Actions #20

Updated by Gerrit Code Review over 10 years ago

Patch set 1 for branch TYPO3_6-1 has been pushed to the review server.
It is available at https://review.typo3.org/24177

Actions #21

Updated by Gerrit Code Review over 10 years ago

Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/24178

Actions #22

Updated by Dmitry Dulepov over 10 years ago

  • Status changed from Under Review to Resolved
Actions #23

Updated by Gerrit Code Review over 10 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at https://review.typo3.org/24182

Actions #24

Updated by Gerrit Code Review over 10 years ago

Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at https://review.typo3.org/24981

Actions #25

Updated by Jigal van Hemert over 10 years ago

  • Status changed from Under Review to Resolved
Actions #26

Updated by Simon Schaufelberger over 10 years ago

Hey, Why is this NOT included in 4.5??? so sad...

Actions #27

Updated by Markus Klein over 10 years ago

@Simon: It will be finally included.

Actions #28

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF