jackalope / jackalope-doctrine-dbal

Doctrine DBAL transport implementation for Jackalope
http://jackalope.github.io
Other
143 stars 60 forks source link

Improve performance when deleting a property #390

Closed wachterjohannes closed 2 years ago

wachterjohannes commented 2 years ago

I have found another performance problem when we have big nodes (10000+ properties). Inside of the function Client::deleteProperty we spend most of the time when updates such nodes (with write, delete operations).


Before

Spend in Method: 21.7s

Profile https://blackfire.io/profiles/28b1016c-b67b-4f2c-a0cc-9dca6349a963/graph

image

After

Spend in Method: 528ms

Profile https://blackfire.io/profiles/40b5060b-1888-49b0-8f5e-08d9c1cb12ac/graph

image


To avoid iterating over all the properties this PR uses XPath to load only the needed property.

As i have not changed anything at the logic there is no change in the tests required.

wachterjohannes commented 2 years ago

@dbu what do you think about that change?

dbu commented 2 years ago

https://github.com/jackalope/jackalope-doctrine-dbal/releases/tag/1.7.3

wachterjohannes commented 2 years ago

@dbu thanks for the fast response and also the release :)

we are currently debugging performance issues for several clients and tackle often the problem with a lot of properties. Improving that step by step makes it better for everyone 😂 but yeah the soft border of 10000 property is known but sometimes hard to not break through it.

Thanks again