Project

General

Profile

Actions

Bug #95042

closed

email validation makes link generation unnecessary costly

Added by Sebastian Michaelsen over 2 years ago. Updated over 2 years ago.

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

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Whenever links are generated with "legacy" parameter, the \TYPO3\CMS\Core\LinkHandling\LegacyLinkNotationConverter checks if the provided parameter is a valid email address. For validation we use the 3rd party library egulias/email-validator. With blackfire I determined that this library is quite costly in terms of memory and wall time.

I added this simple early return to GeneralUtility::validEmail():

        if (strpos($email, '@') === false) {
            return false;
        }

And it significantly improved the speed of links generation. I don't know if that is a suitable solution for the core, or if such a fix should get into the library itself.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #93890: Move email check in LegacyLinkNotationConverter to the endClosed2021-04-09

Actions
Actions

Also available in: Atom PDF