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

Fix performance (PHP5) and memory (PHP7) issues when using token_get_all#17377

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 2 commits intosymfony:2.3fromnicolas-grekas:no-ref
Jan 15, 2016

Conversation

@nicolas-grekas
Copy link
Member

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

Although it's not the case anymore on PHP 7, on PHP 5,is_array checks are much slower thanisset checks.

Also from@peteward in#17384:

New PHP7 memory manager will not release small buckets to OS automatically in cases exposed bytoken_get_all(). This function call addition specifically for PHP7 will reclaim this memory to keep the footprint down of long processe

See above ticket and suggested actions by PHP internals team for long-running tasks (https://bugs.php.net/70098) - I thinkcache:clear/warmup on a heavy app justifies this.

We're running on cloud-based hosting platforms under memory limitations (Platform.sh). When memory is exceeded we're into swap and the cache clearing process goes from seconds to minutes for the initial deployment, which really slows our development workflow and also causes holding page delays.

…y manager will not release small buckets to OS automatically
@nicolas-grekasnicolas-grekas changed the titleFix perf and mem issue when using token_get_allFix performance (PHP5) and memory (PHP7) issues when using token_get_allJan 15, 2016
@Tobion
Copy link
Contributor

LGTM 👍

Status: Reviewed

@fabpot
Copy link
Member

Thank you@nicolas-grekas.

@fabpotfabpot merged commite555aad intosymfony:2.3Jan 15, 2016
fabpot added a commit that referenced this pull requestJan 15, 2016
… token_get_all (nicolas-grekas, peteward)This PR was merged into the 2.3 branch.Discussion----------Fix performance (PHP5) and memory (PHP7) issues when using token_get_all| Q             | A| ------------- | ---| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#16868| License       | MIT| Doc PR        | -Although it's not the case anymore on PHP 7, on PHP 5, `is_array` checks are much slower than `isset` checks.Also from@peteward in#17384:>  New PHP7 memory manager will not release small buckets to OS automatically in cases exposed by `token_get_all()`. This function call addition specifically for PHP7 will reclaim this memory to keep the footprint down of long processe> See above ticket and suggested actions by PHP internals team for long-running tasks (https://bugs.php.net/70098) - I think `cache:clear/warmup` on a heavy app justifies this.> We're running on cloud-based hosting platforms under memory limitations (Platform.sh). When memory is exceeded we're into swap and the cache clearing process goes from seconds to minutes for the initial deployment, which really slows our development workflow and also causes holding page delays.Commits-------e555aad Add gc_mem_caches() call for PHP7 after itoken_get_all() as new memory manager will not release small buckets to OS automaticallyd1f72d8 Fix perf and mem issue when using token_get_all
@nicolas-grekasnicolas-grekas deleted the no-ref branchJanuary 19, 2016 08:27
@fabpotfabpot mentioned this pull requestFeb 3, 2016
protectedfunctionnormalizeToken($token)
{
if (is_array($token)) {
if (isset($token[1]) &&'b"' !==$token) {
Copy link
Contributor

Choose a reason for hiding this comment

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

what is this'b"' case about?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

a funny special case of the tokenizer, seehttps://3v4l.org/P4ZNQ

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@nicolas-grekas@Tobion@fabpot@staabm@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp