8000 [HttpKernel] Garbage collection in LoggerDataCollector took about 50% of all execution time by vtsykun · Pull Request #23620 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpKernel] Garbage collection in LoggerDataCollector took about 50% of all execution time #23620

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
LoggerDataCollector: caching data for performance in dev mode
  • Loading branch information
vtsykun committed Jul 21, 2017
commit e60e42fb94cc7a7cc92a9c9c348c02588511b4f6
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class LoggerDataCollector extends DataCollector implements LateDataCollectorInte
{
private $logger;
private $containerPathPrefix;
private static $serializeData;

public function __construct($logger = null, $containerPathPrefix = null)
{
Expand All @@ -43,12 +44,24 @@ public function collect(Request $request, Response $response, \Exception $except
// everything is done as late as possible
}

/**
* {@inheritdoc}
*/
public function serialize()
{
if (null === self::$serializeData) {
self::$serializeData = serialize($this->data);
}

return self::$serializeData;
}

/**
* {@inheritdoc}
*/
public function lateCollect()
{
if (null !== $this->logger) {
if (null !== $this->logger && null === self::$serializeData) {
$containerDeprecationLogs = $this->getContainerDeprecationLogs();
$this->data = $this->computeErrorsCount($containerDeprecationLogs);
$this->data['compiler_logs'] = $this->getContainerCompilerLogs();
Expand Down
0