Details
-
Bug
-
Resolution: Fixed
-
Medium
-
None
-
None
-
None
Description
Depending on the number of Content assigned to the workflow, page loading time, memory used and cache calls for backends workflow view increased with each content in the workflow.
Steps to reproduce
1. Clean installation of Ibexa DXP 3.3
2. Create a workflow as described in the documentation:
https://doc.ibexa.co/en/latest/guide/workflow/workflow/#workflow-configuration
3. Create a new Command:
src/Command/CreateFoldersCommand.php
<?php namespace App\Command; use eZ\Publish\API\Repository\ContentService; use eZ\Publish\API\Repository\ContentTypeService; use eZ\Publish\API\Repository\LocationService; use eZ\Publish\API\Repository\Repository; use eZ\Publish\API\Repository\UserService; use eZ\Publish\Core\FieldType\TextLine\Value; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class CreateFoldersCommand extends Command { const PARENT_LOCATION_ID = 42; protected static $defaultName = 'app:create-folders'; /** @var \eZ\Publish\API\Repository\ContentService */ private $contentService; /** @var \eZ\Publish\API\Repository\ContentTypeService */ private $contentTypeService; /** @var \eZ\Publish\API\Repository\LocationService */ private $locationService; /** @var \eZ\Publish\API\Repository\UserService */ private $userService; /** @var \eZ\Publish\API\Repository\Repository */ private $repository; public function __construct( ContentService $contentService, ContentTypeService $contentTypeService, LocationService $locationService, UserService $userService, Repository $repository ) { $this->contentService = $contentService; $this->contentTypeService = $contentTypeService; $this->locationService = $locationService; $this->userService = $userService; $this->repository = $repository; parent::__construct(); } protected function execute(InputInterface $input, OutputInterface $output): int { $folderCT = $this->contentTypeService->loadContentTypeByIdentifier('folder'); /** @var \eZ\Publish\API\Repository\Values\Content\Content $adminUser */ $adminUser = $this->repository->sudo(function () { return $this->userService->loadUserByLogin('admin'); }); for ($i = 1; $i <= 10000; $i++) { $contentCreateStruct = $this->contentService->newContentCreateStruct($folderCT, 'eng-GB'); $contentCreateStruct->setField('name', new Value('Folder-' . $i . '-' . rand(1000,9999))); $contentCreateStruct->ownerId = $adminUser->contentInfo->id; $locationCreateStruct = $this->locationService->newLocationCreateStruct(self::PARENT_LOCATION_ID); $this->repository->sudo(function () use ($contentCreateStruct, $locationCreateStruct) { $this->contentService->createContent($contentCreateStruct, [$locationCreateStruct]); }); } return Command::SUCCESS; } }
4. Execute newly create command
php bin/console app:create-folders
5. Check "Custom workflow" in the back office
6. Execute the command again
Result
With each command execution memory usage, the number of calls to the cache and render time doubles.
Expected result
Number of content created does not affect workflow view performance.