Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor #6011 Performance optimization in FieldCollection (javiereguiluz)
This PR was merged into the 4.x branch. Discussion ---------- Performance optimization in FieldCollection EasyAdmin is pretty fast, but from time to time I profile some apps to check possible performance improvements using the amazing [Blackfire profiler](https://blackfire.io/). While checking the `detail` page of some entity I saw this: <img width="418" alt="performance-issue" src="https://github.com/EasyCorp/EasyAdminBundle/assets/73419/aa9ee069-a2b5-4709-acaa-168ee6e65d4c"> 5,000 calls to `FieldDto::getUniqueId()` and another 5,000 calls to Symfony's `Ulid::__toString()` 😱 If you check the changes of this PR, it's easy to understand why. The field collection is already indexed by the field's uniqueID, so let's reuse it instead of recomputing it. This is the before/after comparison: <img width="654" alt="optimization-result" src="https://github.com/EasyCorp/EasyAdminBundle/assets/73419/119495b6-3bea-4cce-a0fe-06b33062ac04"> Commits ------- d807133 Performance optimization in FieldCollection
- Loading branch information