473,406 Members | 2,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

C# program takes 8 seconds to start as cgi process

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

--
Clive Tooth
www.clivetooth.dk
Nov 17 '05 #1
5 2610
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.

"The Last Danish Pastry" <cl****@gmail.com> wrote in message
news:3s************@individual.net...
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

--
Clive Tooth
www.clivetooth.dk

Nov 17 '05 #2
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:OD*************@TK2MSFTNGP15.phx.gbl...
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...

--
Clive Tooth
www.clivetooth.dk

"The Last Danish Pastry" <cl****@gmail.com> wrote in message
news:3s************@individual.net...
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.

Nov 17 '05 #3
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.

"The Last Danish Pastry" <cl****@gmail.com> wrote in message
news:3s************@individual.net...
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:OD*************@TK2MSFTNGP15.phx.gbl...
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...

--
Clive Tooth
www.clivetooth.dk

"The Last Danish Pastry" <cl****@gmail.com> wrote in message
news:3s************@individual.net...
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.


Nov 17 '05 #4
This article by Justin Williams should be helpful:

http://www.codeproject.com/csharp/cgi_csharp.asp

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"The Last Danish Pastry" wrote:
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

--
Clive Tooth
www.clivetooth.dk

Nov 17 '05 #5

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

Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Arnold | last post by:
I need to modify my existing program into two separate executables. The first exe will be executed once to initiate a hardware card, the second program exe can be called multiple times to process...
6
by: David | last post by:
Hi, I am writing a C# program and want to run a java application and pass it a filename as a parameter. I want to be able to write a method in C# that will run this Java app for me. Eg. I want...
4
by: Sam | last post by:
Service properties ------------------ Log On As: LocalSystem Logon account has full admin privileges. OnStart() routine ----------------- { EventLog->WriteEntry ("Commencing..."); .... A
10
by: Amelyan | last post by:
It takes VS 2005 1, 2, and somtimes 3 MINUTES to compile ASP.NET 2.0 website when external DLL is modified. As a matter of fact, when I click 'Build', it looks like VS 2005 hangs for most of that...
10
by: preethamkumark | last post by:
- The program first creates a shared memory buffer containing an array of 20 integers. - Each slot of the buffer can have either 0 or 1, where 0 represents an empty slot, and 1 represents an...
0
by: spamfilteraccount | last post by:
Hi, I have simple GUI with a listbox containing file names. If I select a file and press ENTER it should be opened. It works, but things are working strangely. Here's the code I use to open...
12
by: elty123 | last post by:
I have a small C# program (about 400 lines of code) that is only 28kb after compiled. However when it runs (takes a whole 5 seconds) it takes up nearly 20MB of memory and I don't see why. ...
0
by: balach | last post by:
hi all, i am using this code to initialize and assign it to a process, i am calling a thread on every 10 Seconds to fire vbscript file, this activity is performed on "timer1_Tick( )" event and...
0
amitpatel66
by: amitpatel66 | last post by:
There is always a requirement that in Oracle Applications, the Concurrent Program need to be execute programatically based on certain conditions/validations: Concurrent programs can be executed...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.