I take it for granted that I expressed clearly enough in my last message, It seems I 
am wrong :(

I use 3 different languages to develop the same functions to compare different 
performance
of the languages.
for example to test the performance of socket operations  :in c#
DateTime start, end
TimeSpan last
<prepare for the connection >
while (count<100000)
{
start=Datetime.now
mynetworkstream.write(...)  //write to echo server
mynetworkstream.Read(...)// get from echo server
end = Datetime.now
last += (end-start)
count++;
}
<clean up>
each time (end-start) = Time for C#' send operation with socket 
                                + network delay 
                                + echo server process time 
                                + network delay 
                                + Time for C#' read operation with socket.

I use the same size of buffer, same echo server, same machines to test 3 language's 
socket operation abilities .
I didn't count the exceptions and errors in my test. cause I am not testing the speed 
of error recover operation.
. 
And for the database performance
I use sqlcommand.ExecuteNonQuery() in C# to insert a simple data into SQL server. 
use SQLExecDirect(hStmt,chSql,SQL_NTS) in VC to do the same stuff.
I set a timestamp before I call sqlcommand.ExecuteNonQuery() and set another timestamp 
after the call.
I think 
<EndTimestamp -  StartTimestamp> 
           = Time for sqlcommand to send request 
           + round trip networkdelay 
          + SQL server process time 
          + Time for sqlcommand to process result from SQLserver

For applications, the performance is not just affected by DB and Network operations,but
my system's performance bottle neck is DB operation and Socket operation. I try to 
gather more 
info to persuade the boss move to C# .


>From the view of compiler and interpreter. Java and C#  are compiled to a bicode and 
>run
on JVM /CLR . which will be slower than VC bincode run on top of System.
Over all , C# (in win2000) is slower than VC. The thing I don't know and try to ask is 
that ,
 if Microsoft optimizes CLR in win2003 , so that CLR in win2003 runs faster than CLR 
in win2000?
and how faster it could be?


Leo Wu


  ----- Original Message ----- 
  From: Griffiths, Ian 
  To: [EMAIL PROTECTED] 
  Sent: Monday, June 16, 2003 9:13 PM
  Subject: Re: [ADVANCED-DOTNET] The performance of .Net with Win2000


  It's impossible to tell what you mean by this message. It's possible
  that you're saying that Java is 10 times slower than VC, or possibly
  that it's 10 times faster.  (I'm guessing though that you mean C# is in
  the middle.)

  Where does the TCP echo server come into this?  What are your tests
  actually doing?  What metric are you using the measure "the
  performance"?  Is this requests per second?  Request processing time
  (and if so, under what kind of load)?

  It's impossible to tell what operations are involved in the test, so
  there's no way anyone could be expected to repeat your tests on Windows
  2000 as you have done them, let alone try to produce a comparable
  experiment on W2k3.

  Your figures appear to be meaningless as posted, so could you provide a
  little more detail?


  -- 
  Ian Griffiths
  DevelopMentor

  -----Original Message-----
  From: Leo Zhaobin Wu [mailto:[EMAIL PROTECTED] 

  I compare the performance of .Net , VC and Java under windows 2000
  server.
  bellow is the test data.

  SQL Server runs on another machine.
  2 Tcp echo server run on other Unix machines.

  1.Framework 1.1   C#
  Asyc ADO.Net and Asyc socket , thread pool ,C# windows application. 
  2.
  Visual C++ 6.0 
  IOCP , ODBC , winsocket  , windows application
  3.
  Java SDK 1.4 
  JDBC,java socket  , windows application

  No matter how I change the portions of net operations or database
  operations ,the performance
  of three languages looks like :   VC : C# : Java  = 1 : 3 : 10  

  The data is under win2000.
  I wonder if anyone here has ever done such test under win2003 ?

  Leo Zhaobin Wu

Reply via email to