1

Closed

Slow first call to a service

description

The first call to a ria service is slow if they are many assemblies without PublicKeyToken (5s on my project).

The problem is the try/catch in OpenRiaServices.DomainServices.TypeUtility.IsSystemAssembly.

Solution : test if the key is null
try
{
     if (assemblyFullName.Substring(idx + 15, 4) == "null")
        return false;

     string publicKeyToken = assemblyFullName.Substring(idx + 15, 16);
      return systemAssemblyPublicKeyTokens.Any(p => p.Equals(publicKeyToken, StringComparison.OrdinalIgnoreCase));
 }
catch (ArgumentOutOfRangeException)
{
      return false;
}
With this modification, the first call take 0.8s.
Closed Aug 21, 2016 at 11:22 AM by danneesset
Part of 4.5.0-rc1 release

comments

danneesset wrote Jul 2, 2016 at 11:14 AM

Can you please try using the latests version to se if this is already resolved.

This should be fixed in changeset 3bff1ce061f18f98ed3f4900c71490ae88321ff (before 4.5.0-beta3 release)
https://openriaservices.codeplex.com/SourceControl/changeset/13bff1ce061f18f98ed3f4900c71490ae88321ff

Mega_ wrote Jul 4, 2016 at 7:47 AM

With the lastest sources, this isn't resolved.

The assemblyFullName contains "PublicKeyToken=" but the key is "null" and "assemblyFullName.Substring(idx + 15, 16)" causes a exception.

ex:
assemblyFullName = "Futura.Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"

Mega_ wrote Jul 11, 2016 at 10:37 AM

How to change work item status ?

danneesset wrote Jul 11, 2016 at 6:50 PM

I think I have created a fix for the issue.

Would you please try to see if my pull request solves your issue.

https://openriaservices.codeplex.com/SourceControl/network/forks/danneesset/openriaservices/contribution/8894

danneesset wrote Aug 20, 2016 at 1:11 PM

Fixed in changeset 7813ae24073cb929252943d43af1fbe4c2a3bf57