10000 [Form/Profiler] Massively reducing memory footprint of form profiling… · symfony/symfony@5f5077f · GitHub
[go: up one dir, main page]

Skip to content

Commit 5f5077f

Browse files
author
Vincent Chalnot
committed
[Form/Profiler] Massively reducing memory footprint of form profiling pages by removing redundant 'form' variable from view variables.
1 parent 08b7874 commit 5f5077f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Symfony/Component/Form/Extension/DataCollector/FormDataExtractor.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\Form\FormView;
1616
use Symfony\Component\HttpKernel\DataCollector\Util\ValueExporter;
1717
use Symfony\Component\Validator\ConstraintViolationInterface;
18+
use Symfony\Component\VarDumper\Caster\CutStub;
1819

1920
/**
2021
* Default implementation of {@link FormDataExtractorInterface}.
@@ -155,6 +156,10 @@ public function extractViewVariables(FormView $view)
155156
);
156157

157158
foreach ($view->vars as $varName => $value) {
159+
// Removing redundant variable from view variables
160+
if ('form' === $varName) {
161+
$value = new CutStub($value);
162+
}
158163
$data['view_vars'][$varName] = $value;
159164
}
160165

0 commit comments

Comments
 (0)
0