-
Notifications
You must be signed in to change notification settings - Fork 14
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
IBX-7911: Used strict getters for content tree loading code paths #347
Conversation
8471511
to
e5df373
Compare
Quality Gate passedIssues Measures |
e5df373
to
309d64a
Compare
fb4bf3f
to
e23f8d0
Compare
Co-Authored-By: Paweł Niedzielski <Steveb-p@users.noreply.github.com>
Co-Authored-By: Konrad Oboza <konradoboza@users.noreply.github.com>
a5f4540
to
cc1dc55
Compare
cc1dc55
to
6f2708b
Compare
Quality Gate passedIssues Measures |
Update via 7869457: seems
Discovered by AdminUI REST integration tests for content tree endpoint 🎉 (ibexa/admin-ui#1212)
|
* | ||
* @var string[] | ||
*/ | ||
protected array $path; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idea for improvement in 5.x: introduce dedicated Value Object representing path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compared time needed to load content tree with and without changes from https://issues.ibexa.co/browse/IBX-7911 & https://issues.ibexa.co/browse/IBX-8280.
On different attempts observed an improvement between 20% and 30%.
QA Approved on Ibexa Commerce 4.6.7-dev.
v4.6
We've known for quite some time that magic property getter
__get
on ourValueObject
doesn't scale very well as it's time consuming and creates significant overhead.This PR adds strict getters for
Content
,ContentInfo
,Location
,VersionInfo
,ContentType\FieldDefinition
,User\User
,Security\User
,SimplifiedRequest
and documents deprecation of corresponding@property-read
entries. It also refactors usages of magic getters found in code paths executed when loading the content tree viaAdminUi\ContentTreeController::loadSubtreeAction
.The Blackfire profile shows that for ~170 calls to
Ibexa\AdminUi\Siteaccess\SiteaccessResolver getSiteAccessesListForLocation
, there's about 184 000 calls to magic getter, taking more than 1s of total execution time for a very big content tree:The general recommendation would be to introduce a Rector which would add getters in place of
@property-read
and refactor usage, however this PR solves part related to the performance issue at hand.Review notes
Added
ContentDomainMapper::mapPersistenceContentTypeToApi
method to translate legacy usage of persistence content type into API content type. Forcing getters inbuildDomainFields
method makes passing directly persistence Content Type not feasible (properties match, however persistence one has public properties, therefore there are no getters)Checklist:
$ composer fix-cs
).