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 #1

Updated by Gerrit Code Review over 2 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70855

Actions #2

Updated by Christian Kuhn over 2 years ago

  • Related to Bug #93890: Move email check in LegacyLinkNotationConverter to the end added
Actions #3

Updated by Gerrit Code Review over 2 years ago

Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71195

Actions #4

Updated by Gerrit Code Review over 2 years ago

Patch set 2 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71195

Actions #5

Updated by Gerrit Code Review over 2 years ago

Patch set 3 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71195

Actions #6

Updated by Georg Ringer over 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #7

Updated by Benni Mack over 2 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF