Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit44ce4dd

Browse files
committed
bug#27923 [Form/Profiler] Massively reducing memory footprint of form profiling pages... (VincentChalnot)
This PR was merged into the 3.4 branch.Discussion----------[Form/Profiler] Massively reducing memory footprint of form profiling pages...… by removing redundant 'form' variable from view variables.| Q | A| ------------- | ---| Branch? | 3.4| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets || License | MIT| Doc PR |## ProblemWhen trying to profile large forms in web profiler, the page can get so big that the memory footprint of the web browser excedes 1Gb making everything unusable and sometimes crashing the browser.This is especially true for "deep" forms as every node of the form also contains its children in the debugging infos.## SolutionWhen removing the "form" view variable that actually contains duplicated contents of everything already displayed in the page, the memory footprint massively decrease making the page usable again even form very complex and deep forms.By using CutStub, we keep a necessary level of information by providing the information that the variable is indeed here but not directly accessible in the dump.Commits-------5f5077f [Form/Profiler] Massively reducing memory footprint of form profiling pages by removing redundant 'form' variable from view variables.
2 parents137753d +5f5077f commit44ce4dd

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
useSymfony\Component\Form\FormView;
1616
useSymfony\Component\HttpKernel\DataCollector\Util\ValueExporter;
1717
useSymfony\Component\Validator\ConstraintViolationInterface;
18+
useSymfony\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->varsas$varName =>$value) {
159+
// Removing redundant variable from view variables
160+
if ('form' ===$varName) {
161+
$value =newCutStub($value);
162+
}
158163
$data['view_vars'][$varName] =$value;
159164
}
160165

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp