Opened 13 years ago

Closed 13 years ago

#1914 closed defect (fixed)

ResourceExists in MaestroAPI takes 1 second to execute with LocalNative-Connection

Reported by: gBecker Owned by: jng
Priority: high Milestone: Maestro-5.0
Component: Maestro Version: 2.2.0
Severity: critical Keywords:
Cc: External ID:

Description

When using LocalNative-Connection the methode ResourceExists of the ResourceService takes more than 1 second to execute. Sometimes my WebPages needs up to 10 seconds to load because of high usage of this methode. With the old API the site loads very fast.

You can reproduce the problem with the SampleWeb of MaestroSDK_4.0.0. Create a LocalNative-Connection and wrap tracing around the ResourceExists methode in Default.aspx.cs:

Trace.Write("Begin"); if (conn.ResourceService.ResourceExists(mdfId)) {

Trace.Write("End");

Gunter

Change History (3)

comment:1 by jng, 13 years ago

The problem is that the local native implementation of ResourceExists() does a version check (against the SiteVersion property) to determine if the underlying MgResourceService.ResourceExists() is safe to call

SiteVersion is lazy loaded and it is this initial load that takes one second to complete. The property also only lives for the duration of the connection, which would probably explain why it takes 1s on every request as it is a different connection instance each time.

Since for local native connections, the site version is well-known because we're referencing against the official API, which exists in a known set of releases, we can just hard-code the return value, instead of interrogating MgServerAdmin for the actual version number. This will eliminate the 1s delay for ResourceExists() and any other API that needs to do version checks.

comment:2 by jng, 13 years ago

Fixed r6428

comment:3 by jng, 13 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.