Alexander-Schranz
Alexander Schranz
Core Developer – Sulu GmbH
Core developer and support king. So dedicated to his work that we couldn't find a hobby to mention.
@alex_s_

Sulu Release 2.2.11 & 2.3.1: Improved performance for your projects

We are happy to announce that we have published Sulu 2.2.11 and Sulu 2.3.1 today! The new patch releases come with a big performance improvement when managing pages and other content stored in the PHPCR content repository.

PHPCR Performance Improvements

As part of our partner program, we conducted a project review for our gold partner Webstores B.V.. One task of the review was to analyze the performance when viewing pages that are not cached yet. Thanks to the information provided by Webstores B.V., we were quickly able to reproduce the setup and find potential performance bottlenecks. Using Blackfire profiles, we were able to identify a performance regression related to the page permission feature introduced in the Sulu 2.2 release.

To solve this regression, we changed the format that is used for storing page permission in PHPCR. This change improved the loading time of the affected page by 20 percent from 1.4 seconds to 1.1 seconds. But we did not stop there.

While analyzing the Blackfire profiles created during the project review, we noticed that a lot of time is spent on XML parsing inside of the jackalope/jackalope-doctrine-dbal package. This package implements the default Sulu PHPCR storage and therefore is used in most Sulu projects. We figured that the package uses the PHP DOM extension instead of the more performant PHP XML extension for XML parsing and decided to try if we could improve performance by changing this. After refactoring the relevant parts of the package, we used the apache benchmarking tool instead of Blackfire to measure the average loading time without any profiling overhead. The benchmark showed that the refactoring improved the loading time by another 45% from 1.1 second to 0.58 seconds.

At this point, we want to thank the great David Buchmann that maintains the jackalope phpcr packages and has reviewed our refactoring pull request. The change was already released as version 1.7.0 of the package, which means that even older Sulu 1.x projects will benefit from the performance improvements.
 

In total, we were able to improve the loading time of the uncached page by about 60 percent from 1.4 seconds to 0.58 seconds in the course of the project review. We want to thank our partner Webstores B.V. for their support and the opportunity to improve Sulu for all its users. We are especially happy that these improvements will not only benefit all Sulu 2.x projects, but even improve performance in Sulu 1.x projects. If you are working on a Sulu project and are interested in a project review, development training or technical consulting, please don't hesitate to contact us.

Upgrading your Project

We have changed the format used for storing page permissions in PHPCR. If you use page permissions in your project, you can use the

bin/console phpcr:migrations:migrate 

command to migrate the existing data to the new format. Make sure to execute the command after upgrading your project to one of the newly released Sulu versions. 

We encourage you to have a look at our Upgrading Sulu 2.x documentation when upgrading your project. The documentation provides a step-by-step guide to upgrading Sulu in your projects. Feel free to contact us if you have any questions or problems during the upgrade process.

AND and OR keyword in Conditions

Sulu allows the use of disabledCondition and visibleCondition attributes to disable or hide properties based on the values of other properties inside of page templates and form configurations. The newly released versions allow to use the AND and OR keyword for combining conditions inside of these attributes.

<!-- Before -->
<property name="code" type="text_line" visibleCondition="isCode &amp;&amp; isSomething">
    <!-- ... -->
</property>

<property name="code" type="text_line" visibleCondition="isCode || isSomething">
    <!-- ... -->
</property>


<!-- After -->
<property name="code" type="text_line" visibleCondition="isCode AND isSomething">
    <!-- ... -->
</property>

<property name="code" type="text_line" visibleCondition="isCode OR isSomething">
    <!-- ... -->
</property>

Full changelog on GitHub

In addition to the improvements listed above, Sulu 2.2.11 and Sulu 2.3.1 include multiple small bugfixes that improve the experience for developers and content managers. Have a look at the release on GitHub to find a list of all changes included in the release.

What is coming next?

After the initial release of Sulu 2.3 a few weeks ago, we have started the planning phase for Sulu 2.4. We plan to release this next minor release in the end of 2021 and have already begun with improving the user experience of the administration interface navigation. Beside of that, we are working on the implementation of a new storage adapter for the SuluArticleBundle that builds upon the SuluContentBundle. The new storage adapter will make it possible to use the SuluArticleBundle without running an Elasticsearch server.

We are happy to hear your feedback about newly released features and bug fixes. Feel free to create an issue or a discussion on GitHub for bugs and feature requests. You can also contact us via Slack or our Website anytime.