Current filter:
          You should refresh the page.
          Not Logged In

          How to improve the performance to delete huge and complex data in XpCollection?

          0
            • Dear DevExpress,

              Please see the attachment. I already profile my application using dotTrace Performance.
              As we can see, it takes 295 seconds to process LookAheadDetail.OnDeleting.
              The speed is very slow, and it is unacceptable by the client.
              In OnDeleting function, part of the code to delete CostRules is :

              CostRules.DeleteObjectOnRemove = True
              While CostRules.Count > 0
                CostRules.Remove(CostRules(0))
              End While

              I already tried to replace the above code to :

              CostRules.DeleteObjectOnRemove = True
              Session.Delete(CostRules)

              but the result is same. It does not improve the performance.
              I have no idea how to improve speed to remove the CostRules.
              Do you have any idea?

              I look forward to read your reply.
              Many thanks.

              Kind Regards,

              Andreas Kurniawan.

          xpcollection performance.jpg
          0

          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

          0

          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.

          Q335700.zip
          0

          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

          0

          Dear Dennis,

          I am not sure, but I think it is enough to create an LookAheadDetail instance and several CostRules.
          I have 10928 CostRules in one LookAheadDetail here. I hope you can reproduce it on your side.

          I look forward to read your reply.
          Many thanks.

          Kind Regards,

          Andreas Kurniawan.

          0

          Thank you for the update, Andreas! Will do!

          Regards,
          Dennis

          0

          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.

          See Also:
          XPO should not automatically pre-load an associated collection when I only need to insert a new object into it

          Thanks,
          Dennis

          0

          Dear Dennis,

          Thank you very much for the suggestion to use IList.
          However, I am not sure if I can use IList for that, because I need to use XPCollection properties like Criteria, Filter, etc.

          I look forward to read your reply.
          Many thanks.

          Kind Regards,

          Andreas Kurniawan.

          0

          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

          0

          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.

          0

          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

          0

          Dear Dennis,

          Thank you very much for the update. It is a very good news.
          When will devexpress release the new version (2011 vol 2)?
          Is it possible to get the patch/hotfix for 11.1.7 while waiting for the new release?

          I look forward to read your reply.
          Many thanks.

          Kind Regards,

          Andreas Kurniawan.

          0

          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

          You must  log in  or  register  to leave an answer