473,805 Members | 2,141 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2624
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.c om> 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***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:OD******** *****@TK2MSFTNG P15.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.c om> 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.c om> wrote in message
news:3s******** ****@individual .net...
"Kevin Spencer" <ke***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:OD******** *****@TK2MSFTNG P15.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.c om> 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
2006
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 data. The second program calls a member function of the first program so it needs access to the object created by the first exe. How can I do this? More if details if you are curious: I am writing a program which initializes and loads up a pci...
6
9136
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 to run the following command: java MyApplication filename.extension Can anyone help me?
4
2495
by: Sam | last post by:
Service properties ------------------ Log On As: LocalSystem Logon account has full admin privileges. OnStart() routine ----------------- { EventLog->WriteEntry ("Commencing..."); .... A
10
1464
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 time before it actually starts compiling. If I modify something inside WebSite project itself without modifying DLL, it takes few seconds to compile. Why? How can I control this behavior? I was able to reproduce this behavior by creating a...
10
2023
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 occupied one. - Initially, the buffer is empty. Thus, all the slots are initialized with 0.
0
1089
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 the selected file: Process process = new Process(); ProcessStartInfo psi = new ProcessStartInfo();
12
12158
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. Some of the assembly I used: using System; using System.Collections.Generic;
0
1204
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 give me required information. some times i face problem that the second thread associated with "Dummy.vbs" script file, do not reach at specified remote machine, and give error message after 45 seconds to 1 minute, i want that to terminate its...
0
13362
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 programatically either from UNIX or Oracle PLSQL. In this Section, I will be explaining about calling a Concurrent program from UNIX using the CONCSUB Command. Pre-requisite: 1. Concurrent Program should be registered in oracle Applications...
0
9718
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10613
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10107
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7649
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4327
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.