C# MVC app Slow Odata performance compared with webservices

gatsby0121gatsby0121 Member Posts: 13
edited 2013-06-10 in NAV Three Tier
I've been working on modifying a site which was using navisions webservices from 2009, to use Odata from nav 2013.

I had a webgrid that was populated by data from the navision database using an page exposed as a webservice in 2009.

I changed the code to use the odata service from navision 2013 instead of the traditional webservice.
var custLedgerEntries = from c in nav.CommCustLedgEntries
                                    where c.Document_Type == "Invoice" ||
                                    c.Document_Type == "Credit Memo" ||
                                    c.Document_Type == "Payment"
                                    select new srNav.CommCustLedgEntries { Posting_Date = c.Posting_Date,
                                                 Document_Type = c.Document_Type,
                                                 Document_No = c.Document_No,
                                                 Description = c.Description,
                                                 Original_Amount = c.Original_Amount,
                                                 Remaining_Amount = c.Remaining_Amount,
                                                 Entry_No = c.Entry_No
                                    };

I pass the object to a model field, which is then passed into a webgrid in a view.

The time difference is webservice ~ .2sec odata ~ 4sec, that's upwards for 3.8 seconds. At times it can be 10 seconds.

But I can't seem to figure out where the slowdown is.

Has anyone experienced this?

Comments

  • gatsby0121gatsby0121 Member Posts: 13
    An Update on this issue: It would appear that if I'm in RTC under the same company that the OData service is accessing, the call is very slow, ~2.7 seconds. However If I change the company used by RTC to another company, and then use the Odata service to access the original company (not the company set in RTC), it's fast, less. than .1 second.

    Does anyone know what would explain this behavior?
  • daborgdaborg Member Posts: 54
    Anyone have an update or advice on this?
  • Vincent_VancalberghVincent_Vancalbergh Member Posts: 10
    Let me chime in with my "me too". I'm interested if future web-apps are better off written using OData instead of reading SQL directly..
    Senior Technical Consultant at Edan Business Solutions/Sphinx IT
    Owner of V-Kwadraat (see my blog about Programming and my feed about Gaming!)
  • gatsby0121gatsby0121 Member Posts: 13
    While I am in no way an expert, but after having spoken with my colleagues, we're thinking that maybe there's some kind of profiler that's loaded when you run navision on your local machine, that attaches to the current company, and it might be slowing it down, but again, just a theory.
  • gatsby0121gatsby0121 Member Posts: 13
    I just want to add that this only seems to occur if you are in nav, on your local machine, and logged into the company being accessed by the odata call. If my colleague runs nav client on their machine, connects to my local database and opens the company being accessed by odata, there's no slowdown. Which is why we're thinking there's some profiler running when it's run locally.
Sign In or Register to comment.