I am using aspcompat page attribute in ASP.NET so the com components I call can get at ASP intrinsic objects (Request, Response, Application, etc)
I have quickly created a new test project, one asp.net page and a vb6 com component.
The page does this:
for (int i = 0; i < 1000; i++)
Application["string" + i] = i.ToString();
Debug.WriteLine(string.Format("{0} done adding strings to app",Environment.TickCount));
var asp = new ASPTest.CompClass();
asp.SetProcessId();
Basically I add stuff in the application object and then call the com component.
Set context = GetObjectContext
If Not context Is Nothing Then
Set app = context("Application")
Set ses = context("Session")
Set resp = context("Response")
If Not app Is Nothing Then
OutputDebugString "" & GetTickCount & " writing response"
resp.Write "I see application from vb <br/>"
OutputDebugString "" & GetTickCount & " before "
For i = 100 To 200
resp.Write GetTickCount & " i = " & app("string" & i) & "<br/>"
Next
OutputDebugString "" & GetTickCount & " after "
End If
Else
OutputDebugString "No context"
End If
The problem is that the more stuff I put in the application the slower the vb code becomes. Not all the code though, just when I first try to invoke any method on intrinsic objects, in my example my first resp.Write call. If I add 10000 items in the app resp.Write takes ten seconds to complete, 60000 => timeout.
It seems that when I touch any intrinsic object the first time the runtime does something nasty to make the objects available to COM.
Have you ever seen this? Any suggestion is much appreciated.