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

[Form][EventDispatcher] Fix VarDumper usage related to perf regression#19986

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:masterfromnicolas-grekas:fix-perf
Sep 21, 2016

Conversation

@nicolas-grekas
Copy link
Member

@nicolas-grekasnicolas-grekas commentedSep 20, 2016
edited
Loading

QA
Branch?master
Bug fix?no
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#19978
LicenseMIT
Doc PR-

@nicolas-grekasnicolas-grekas changed the title[EventDispatcher] Fix VarDumper usage related to perf regression[Form][EventDispatcher] Fix VarDumper usage related to perf regressionSep 20, 2016
@nicolas-grekasnicolas-grekasforce-pushed thefix-perf branch 4 times, most recently from992bf19 tob31562dCompareSeptember 20, 2016 12:12
@nicolas-grekas
Copy link
MemberAuthor

Not that this PR will also fix the remaining failure on Travis on 3.1.

@nicolas-grekasnicolas-grekasforce-pushed thefix-perf branch 2 times, most recently from23a5e1f to2be77f5CompareSeptember 20, 2016 13:34
},
));
}else {
@trigger_error(sprintf('Using the %s() method without the VarDumper component is deprecated since version 3.2 and won\'t be supported in 4.0. Install symfony/var-dumper version 3.2 or above.',__METHOD__),E_USER_DEPRECATED);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

this will say that usingFormDataCollector::cloneVar without the component is deprecated, but this is a private method. You should probably talk about the public API triggering it instead

Copy link
MemberAuthor

@nicolas-grekasnicolas-grekasSep 20, 2016
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This has to be done this way: the implementation is changed when the component is not loaded: a string is returned. This mirrors theprofiler_dump function that is able to cope with bothData and strings (deprecated). There is nothing related on the public surface.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Btw, the same is donein the baseDataCollector for BC.

returnarray(
Caster::PREFIX_VIRTUAL.'root' =>$v->getRoot(),
Caster::PREFIX_VIRTUAL.'path' =>$v->getPropertyPath(),
Caster::PREFIX_VIRTUAL.'value' =>$v->getInvalidValue(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

shouldn't you include the message too ?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Just checkedin the original code. This just mirrors it. LGTM.

/**
* {@inheritdoc}
*/
protectedfunctioncloneVar($var)
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

must be protected (as in parent)

@nicolas-grekas
Copy link
MemberAuthor

Now limiting to max-depth=2, which looks more generic than 50 items to me. Internal cache also added to prevent re-cloning the same structures several times. Enhances both perf and serialize payload size.
Seehttps://blackfire.io/profiles/compare/d8d9804b-1939-4a5f-9f47-4ae33c6fc97a/graph

*
* @return array Information about the listener
*/
privatefunctiongetListenerInfo($listener,$eventName)
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This method is removed for two reasons:

  • computed values are not used anymore in the profiler panel, only the data-clones are (same king of cleanupalready done inFormDataExtractor and inDebugAccessDecisionManager);
  • to prevent computing the same info several times, it needs to be persistent, and this responsibility belongs to theWrappedListener class, that knows best about its wrapped listener.

if (null ===$this->cloner) {
if (class_exists(ClassStub::class)) {
$this->cloner =newVarCloner();
$this->cloner->setMaxItems(250);
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

the default is 2500, too much for here

@fabpot
Copy link
Member

Thank you@nicolas-grekas.

@fabpotfabpot merged commit294868e intosymfony:masterSep 21, 2016
fabpot added a commit that referenced this pull requestSep 21, 2016
…f regression (nicolas-grekas)This PR was merged into the 3.2-dev branch.Discussion----------[Form][EventDispatcher] Fix VarDumper usage related to perf regression| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#19978| License       | MIT| Doc PR        | -Commits-------294868e [Form][EventDispatcher] Fix VarDumper usage related to perf regression
@nicolas-grekasnicolas-grekas deleted the fix-perf branchSeptember 21, 2016 20:48
@fabpotfabpot mentioned this pull requestOct 27, 2016
fabpot added a commit that referenced this pull requestDec 2, 2016
This PR was merged into the 3.2 branch.Discussion----------[Form] Remove unused var cloner property| Q             | A| ------------- | ---| Branch?       | 3.2| Bug fix?      | no| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | N/A| License       | MIT| Doc PR        | N/ANot used anymore after#19986EDIT: add missing `use` too.Commits-------0708003 [Form] Remove unused var cloner property
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@nicolas-grekas@fabpot@stof@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp