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

replaced decorate ThemeFilesystemLoader with more efficient Twig\ChainLoader #71

Open
wants to merge 1 commit into
base: 1.5
Choose a base branch
from

Conversation

Fantus
Copy link

@Fantus Fantus commented Nov 15, 2020

Q A
Branch 1.5
Sylius Version 1.8.5
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Related tickets #70
License MIT

Small fix regarding mentioned performance, for example dev toolbar takes very long to load.

Test results in PROD and NO DEBUG (Not much of a difference):

siege http://127.0.0.1:8081/en_US/ -b -c 20 -t2m --no-parser

NO THEME ACTIVE Unchanged Commented Pull request
Transactions: 3463 5147 3776 hits
Availability: 100 100 100 %
Elapsed time: 299.31 299.73 299.15 secs
Data transferred: 62.63 93.09 68.29 MB
Response time: 1.72 1.16 1.58 secs
Transaction rate: 11.57 17.17 12.62 trans/sec
Throughput: 0.21 0.31 0.23 MB/sec
Concurrency: 19.94 19.95 19.95
Successful transactions: 3463 5147 3776
Failed transactions: 0 0 0
Longest transaction: 4.87 3.28 4.52
Shortest transaction: 0.33 0.22 0.34

Test results in DEV and DEBUG:
Great difference, almost doubled the throughput. Mostly thats because during the Symfony\Bridge\Twig\DataCollector\TwigDataCollector::lateCollect needs to resolve the twig template again and this is now correctly cached.

siege http://127.0.0.1:8081/en_US/ -b -c 10 -t2m --no-parser

Transactions: 76 146 hits
Availability: 100 100 %
Elapsed time: 119.47 119.29 secs
Data transferred: 6.73 12.94
Response time: 14.63 7.97 secs
Transaction rate: 0.64 1.22
Throughput: 0.06 0.11 MB/sec
Concurrency: 9.31 9.75
Successful transactions: 76 146
Failed transactions: 0 0
Longest transaction: 19.74 11.93
Shortest transaction: 1.18 1.21
Shortest transaction: 0.33 0.22 0.34

I also tested it with the sylius bootstrap theme active and it works

@Fantus Fantus force-pushed the use_twig_chain_loader branch from ea03c2c to 61c6002 Compare November 15, 2020 23:04
@Fantus Fantus mentioned this pull request Mar 21, 2022
@mario-fehr mario-fehr mentioned this pull request Jun 28, 2022
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.

1 participant