Skip to content
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

[TwigBundle] Created stopwatch tag for profiling templates #8719

Merged
merged 5 commits into from
Aug 13, 2013

Conversation

fabpot
Copy link
Member

@fabpot fabpot commented Aug 11, 2013

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #7953
License MIT
Doc PR symfony/symfony-docs#2630

This PR is the continuation of #7953

This PR adds a new tag to Twig which you can use to time parts of a template and see it in the timing tab of the profiler.

Usage:

{% stopwatch foo %}
... some things that gets timed
{% endstopwatch %}

@fabpot
Copy link
Member Author

fabpot commented Aug 11, 2013

The main differences with the original PR are:

  • I have removed the code that checks is stopwatch is available as the check is already done during compilation
  • I have removed the check for names that was already used as it is not needed (the stopwatch knows how to deal with such cases).

@fabpot
Copy link
Member Author

fabpot commented Aug 12, 2013

I've made further modifications:

  • The stopwatch name can now be any valid expression (more consistent with the other Twig built-in tags)
  • I've removed the possibility to add the name after endstopwatch (because of the previous change and also for more consistency)

fabpot added a commit that referenced this pull request Aug 13, 2013
This PR was merged into the master branch.

Discussion
----------

[TwigBundle] Created stopwatch tag for profiling templates

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #7953
| License       | MIT
| Doc PR        | symfony/symfony-docs#2630

This PR is the continuation of #7953

This PR adds a new tag to Twig which you can use to time parts of a template and see it in the timing tab of the profiler.

Usage:

````jinja
{% stopwatch foo %}
... some things that gets timed
{% endstopwatch %}
````

Commits
-------

29a58e7 change the stopwatch argument to be any valid expression
4590974 removed code that prevents the stopwatch to work properly
2f67776 removed unneeded safeguard as it's already done during compilation
bbad387 fixed CS
f39ed57 Created stopwatch tag
@fabpot fabpot closed this Aug 13, 2013
@fabpot fabpot merged commit 29a58e7 into symfony:master Aug 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants