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

Improve performance of pattern theme hook check #209

Merged
merged 1 commit into from
Aug 26, 2018

Conversation

drclaw
Copy link
Contributor

@drclaw drclaw commented Aug 24, 2018

The check for if a theme hook belongs to a pattern gets called a lot on uncached pages. Enough so that the repeated array_filter calls makes for a non-trivial performance hit (~600ms on an average speed server, medium sized site).

I propose we store all the pattern hooks in a class property and just do a simple array lookup when isPatternHook is called.

ademarco added a commit that referenced this pull request Aug 26, 2018
ademarco added a commit that referenced this pull request Aug 26, 2018
@ademarco ademarco merged commit ff81e70 into nuvoleweb:8.x-1.x Aug 26, 2018
@ademarco
Copy link
Member

Thank you @drclaw !

pookmish pushed a commit to SU-SWS/ui_patterns that referenced this pull request Sep 26, 2018
* Add installer path.

* Remove conflict from composer.json.

* Allow null fields in field group

* Include element defaults in PatternLayout so pattern layouts render properly in panels

* Add some base panels config

* Add a behat test for Panels using a pattern as a layout

* Issue nuvoleweb#147: Fix Behat tests.

* Issue nuvoleweb#147: Remove conflicting configuration.

* Issue nuvoleweb#174: Move jumbotron to test module.

* Issue nuvoleweb#147: Force exit status to true so expected patterns validation error will not stop Travis build.

* Issue nuvoleweb#174: Clear cache.

* Issue nuvoleweb#174: Fix panels test.

* Issue nuvoleweb#169: Integrate OpenEuropa Task Runner and add Docker Compose integration

* Include the current views row as a context (nuvoleweb#180)

* Fix tests for Drupal 8.5 (nuvoleweb#183)

* Issue nuvoleweb#154: Make sure that entity is correctly set before checking if field is supported.

* Adds check for preview and embed for embedded views (nuvoleweb#185)

* Issue nuvoleweb#181: Make fields not required anymore.

* Issue nuvoleweb#181: Update documentation.

* Store pattern hooks in an array keyed by hook name for faster lookup

* Update build process (nuvoleweb#210)

* Pull request nuvoleweb#209: Fix PHPCS issue.

* Missing annotation added.

* nuvoleweb#205 fixed explode to cope with colons in the name

* Fix for ajax and panels.
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