Project

General

Profile

Actions

Bug #63680

closed

Performance of DataHandler with enableLogging=false

Added by Stephan Großberndt over 9 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Performance
Target version:
Start date:
2014-12-08
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

Description

It is possible to disable the Logging to sys_log by setting enableLogging=false. The performance gain could be much bigger because currently all information to log is selected anyway (which is the performance intense part getRecordTitle, WorkspaceOverlay) but is simply thrown away afterwards in the log()-function.

Instead of creating the log-information

if (!$recordAccess) {
    $propArr = $this->getRecordProperties($table, $id);
    $this->log($table, $id, 2, 0, 1, 'Attempt to modify record \'%s\' (%s) without permission. Or non-existing page.', 2, array($propArr['header'], $table . ':' . $id), $propArr['event_pid']);
}

and discarding it in log()

public function log($table, $recuid, $action, $recpid, $error, $details, $details_nr = -1, $data = array(), $event_pid = -1, $NEWid = '') {
    if (!$this->enableLogging) {
        return 0;
    }

the log-information should not be created in the firstplace:

if (!$recordAccess) {
    if ($this->enableLogging) {
        $propArr = $this->getRecordProperties($table, $id);
        $this->log($table, $id, 2, 0, 1, 'Attempt to modify record \'%s\' (%s) without permission. Or non-existing page.', 2, array($propArr['header'], $table . ':' . $id), $propArr['event_pid']);
    }
}

Actions

Also available in: Atom PDF