Teddy
07.29.2011
Hello Andreas,
Thank you for contacting us. We would love to help you improve the performance of your application, but we need a copy of your sample project or at least involved business classes to research your problem internally.
It looks like there is a mistake in your code, because such a huge delay is unexpected. For instance, it looks like the LookAheadDetail class has a non-aggregated (I presume this because you tried to delete it manually) collection of CostRules.
You can mark the CostRules property with the AggregatedAttribute and then remove your deletion code at all. Please test it and let us know whether it makes any difference.
Thanks,
Dennis
Dear Dennis,
Thank you for the suggestion. I already tried to mark the CostRules property with the AggregatedAttribute and remove the deletion code, but it does not improve the performance. When I check the performance with JetBrains dotTrace, the performance is still the same.
I attached LookAheadDetail and CostRule class to this issue. Please advise on how to improve the performance.
I look forward to read your reply.
Many thanks.
Kind Regards,
Andreas Kurniawan.
Hello Andreas,
Thank you for the update! We will put your classes in a test project and try to compile and profile them.
As far as I understand, to replicate your performance problem it is enough to create an LookAheadDetail instance with several CostRules and then delete it. Or do you have any testing data for us? How much CostRules should we link to LookAheadDetail.
We look forward to receiving additional information from you.
Thanks,
Dennis
Hello Andreas,
Thank you for your patience. We have found that the problem might be caused by the XPCollection behavior. Meantime, I suggest you replace XPCollection in your associations with IList as described here: How not Load All Associated Collection only for insert new record. It may greatly speed up the execution.
We will also continue informing you of our progress.
Thanks,
Dennis
Hello Andreas,
Thank you for contacting us. In my previous reply I was talking about replacing XPCollection with IList in you persistent class only. For defining associations between classes only. You should not replace it in other parts of your project, for instance where you bind controls to XPCollection and intensively use its properties.
In addition to the How not Load All Associated Collection only for insert new record issue, I suggest you check out the How to use XPO in Silverlight and How to define a many-to-many association for persistent objects with IList<T> properties help articles, to get more inspiration.
I hope you find this information helpful.
And now good news: our XPO developers have tweaked XPCollection and now it should work as fast as the approach I was talking about above does. To be more precise, the performance is now 10 times faster than before.
Unfortunately, this improvement can be done only starting from version 11.1. So, to use it right now you will have either to upgrade your products to 11.1 and download the latest hot-fix or rework your associations as I suggested earlier.
Please let me know if you need any further clarification on the subject.
Thanks,
Dennis
Dear Dennis,
Thank you very much for the explanation.
However, I am still not sure if I can use IList, even if it is only for defining associations between classes.
I usually use Criteria / Filter within an association. For example : association between LookAheadDetail and CostRule. I usually do something like this : CurrentLookAheadDetail.CostRules.Filter = New BinaryOperator("Oid",-1).
By replacing the XPCollection to IList, then I am not sure if I can use the Filter property again.
I am glad to know that XPO developers have tweaked XPCollection.
Is it possible to get the hot-fix for v2010 vol 2.8?
I look forward to read your reply.
Many thanks.
Kind Regards,
Andreas Kurniawan.
Hello Andreas,
>>
I usually use Criteria / Filter within an association. For example : association between LookAheadDetail and CostRule. I usually do something like this : CurrentLookAheadDetail.CostRules.Filter = New BinaryOperator("Oid",-1).
<<
It is unfortunate to hear that you cannot do it here. However, we do not recommend filtering associations in code because this may lead to confusion or difficultly diagnosed mistakes (e.g. when you forget about this filter and will look for the reason why your grids do not show all data).
Anyway, you can continue using this approach if you are fine with it.
>>
Unfortunately, this improvement can be done only starting from version 11.1. So, to use it right now you will have either to upgrade your products to 11.1 and download the
latest hot-fix or rework your associations as I suggested earlier.
<<
There is no way to get a hot-fix for version 10.2.8. The hot fix for version 11.1 is already available and you can download it from here:
http://downloads.devexpress.com/Share/DXP/110809/DXperience-11.1.6.11221.exe
Thanks,
Dennis
Hi Andreas,
I blogged about this improvement at http://community.devexpress.com/blogs/xpo/archive/2011/09/12/performance-boost-on-removing-data-from-a-large-xpcollection-available-in-11-1-7.aspx
Thanks,
Dennis
Hi Andreas,
Thank you for the feedback.
I am afraid it is impossible to get version 11.2 improvements I mentioned at http://community.devexpress.com/blogs/xpo/archive/2011/09/13/xpo-11-2-sneak-peek-xpcollection-performance-improvements.aspx
in version 11.1. You will have to wait for the 11.2 version release. According to plan, it should be out in 2 months or so. No exact promises as always.
As for the improvements I described at http://community.devexpress.com/blogs/xpo/archive/2011/09/12/performance-boost-on-removing-data-from-a-large-xpcollection-available-in-11-1-7.aspx, you do not need any hot-fix for them, because they are already available in 11.1.7.
Please let me know if I can assist you further.
Thanks,
Dennis