C# program takes 8 seconds to start as cgi process

  • Thread starter Thread starter The Last Danish Pastry
  • Start date Start date
T

The Last Danish Pastry

Why might IIS 5.1 take a long time (8 seconds) to start a C# console
application as a CGI process, but run a Delphi console app that does
the same thing in no time at all?

Apache2 starts and runs the same C# console app as a CGI immediately.

The C# app and Delphi application both send the same, minimal, output
back to the webserver.

Both applications start as normal, and quickly, from Explorer.

Thanks
 
C# is managed .Net code. It must be compiled at run-time to native machine
language.

The upside is that, once compiled, it is cached. Subsequent calls are nearly
as fast as any native code application. There are many optimizations in the
platform. The trade-off is the benefits of managed code, RAD, and the .Net
platform.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.
 
C# is managed .Net code. It must be compiled at run-time to native
machine language.

The upside is that, once compiled, it is cached. Subsequent calls
are nearly as fast as any native code application. There are many
optimizations in the platform. The trade-off is the benefits of
managed code, RAD, and the .Net platform.

Thanks for that. But...

This C# console app is very small. If I compile it and then double
click it from Explorer it has finished within a second. But every time
it starts in the IIS/cgi world it takes 8 seconds to get going. I do
not understand why...
 
If you were talking about using it in an ASP.Net application, I could
probably tell you. But as you're running it under a CGI process, I don't
know. I can only guess that maybe there is some Interop going on, and
Interop is expensive. I avoid it at all cost.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.
 
Hi, Clive !
Why might IIS 5.1 take a long time (8 seconds) to start a C# console
application as a CGI process, but run a Delphi console app that does
the same thing in no time at all?

Apache2 starts and runs the same C# console app as a CGI immediately.

The C# app and Delphi application both send the same, minimal, output
back to the webserver.

Both applications start as normal, and quickly, from Explorer.

Have you heard about HTTP Handlers and modules ?

Check about them at:

http://www.15seconds.com/issue/020417.htm

I think the best approach to have a CGI feature without using ASP.NET is using a
handler.

Regards,

Fernando Monteiro
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top