New Posts New Posts RSS Feed: 7.1.2 -> 7.2.2 weird issue
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

7.1.2 -> 7.2.2 weird issue

 Post Reply Post Reply
Author
smi-mark View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 24-Feb-2009
Location: Dallas, Texas
Posts: 343
Post Options Post Options   Quote smi-mark Quote  Post ReplyReply Direct Link To This Post Topic: 7.1.2 -> 7.2.2 weird issue
    Posted: 31-Oct-2013 at 12:58pm
We are experiencing a weird issue since upgrading to 7.2.2, and it only happens when debugging a SL5 app (OOB mode) from within VS2012.

EntityManager.CacheStateManager.GetCacheState();
and
EntityManager.CacheStateManager.RestoreCacheState(cache, restoreStrategy);

take 5 or so seconds each to run on around 400 entities. When running in browser, or attached to a profiler or just straight from the desktop OOB, it takes no time at all.

I'm not sure at this point what it causing the issue. Any suggestions?

I've also tried changing the mode back to DCS, and it appears to make no difference.
Back to Top
smi-mark View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 24-Feb-2009
Location: Dallas, Texas
Posts: 343
Post Options Post Options   Quote smi-mark Quote  Post ReplyReply Direct Link To This Post Posted: 31-Oct-2013 at 1:26pm
Is EntityProperty.RawInit supposed to throw so many exceptions? It seems to be on the PropertyInfo.GetValue which you have a try/catch around and that is perhaps the performance bottleneck.

It appears to be from within my AuditEntityBase class constructor which is setting some default values
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 31-Oct-2013 at 3:53pm
Get and restore of the EntityCacheState is supposed to be faster as of 7.2.0 - and is in our testing.   We'll take a look to see what could be going on in SL OOB within Visual Studio.
 
As for the RawInit issue, that logic was added to address issues with overridden properties in CF entities.  What first chance exception are you seeing?
Back to Top
smi-mark View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 24-Feb-2009
Location: Dallas, Texas
Posts: 343
Post Options Post Options   Quote smi-mark Quote  Post ReplyReply Direct Link To This Post Posted: 31-Oct-2013 at 7:10pm
I think it's slower in VS just because of all the exceptions from RawInit.

I have an AuditEntityBase and in the constructor we set the create date / mod date to DateTime.Now (we end up resetting it on the SaveInterceptor anyways, so I can try taking this out to see if it's the issue)

With all exceptions turned on we get a null reference, which comes from the RawInit - it looks like the EntityAspect is null. I'll do some more debugging tomorrow and take some screenshots
Back to Top
smi-mark View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 24-Feb-2009
Location: Dallas, Texas
Posts: 343
Post Options Post Options   Quote smi-mark Quote  Post ReplyReply Direct Link To This Post Posted: 01-Nov-2013 at 10:52am
This is where the exceptions keep happening (obviously with exceptions turned off it won't throw it, but I'm wondering if it should be doing this all the time and if that's why it's slow inside VS)


Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 01-Nov-2013 at 11:06am
The exception is expected in certain situations, one of which is when properties are set in a base class constructor.  This logic is called when initializing the default values on a new entity, and is needed due to problems with PostSharp "location binding" with sub-types.   We'll take a look at this again to see what else we can do.
Back to Top
smi-mark View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 24-Feb-2009
Location: Dallas, Texas
Posts: 343
Post Options Post Options   Quote smi-mark Quote  Post ReplyReply Direct Link To This Post Posted: 01-Nov-2013 at 11:31am
Ok. If there is no way around it we could simply remove the default values from the constructor as they are not truly necessary.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down