I have been learning Java, my friend learned C #, I have n'thing to do, we will try to try it is C # or the Java virtual machine is fast. The Java program I wrote is as follows: (Program function: list all the rigid numbers in 200000) // Calculate the current number public class primenumber {public static void main (string args []) {long starttime = system.currentTimeMillis (); int count = 2; system.out.print ("2, 3,"); Boolean ISPN = true; int max = 1000 * 200; for (int i = 4; i My friend wrote the C # program as follows: use system; class test {static void main () {datetime t1 = datetime.now; cal (200000); datetime t2 = datetime.now; timespan t = t2-t1; console.writeLine ("Time is: {0} millisecond / n", t.totalmilliseconds.tostring ()); console.readline ();} static void cal (uint x) {console.write ("2,"); uint sum = 1; for (uint a = 3; a Test on my own machine (machine configuration: p42.4b 512m win2003) Java is JDK1.4.2_05C # for Win2003 comes with .NET 1.1 The comparison result is really frustrated: Java program uses: 13M memory 22 seconds C # program uses: 8M memory 12 seconds "No, SUN How to do a fast 10 years of virtual machine, How can I get so much better than MS .NET virtual machine? "I don't believe it. So I change my Java program to the C # program, the code is as follows: // Calculate the current number Using system; class primenumber {static void main () {datetime t1 = datetime.now; INT count = 2; console.write ("2, 3,"); BOOL ISPN = true; int max = 1000 * 200; for (int i = 4; i In addition to memory usage (this can be understood, the memory used here is only the memory used by JVM, does not mean the memory actually used by the program), and there is no difference in C # program and Java programs in time. Is it a good algorithm written by my friend, but how can I see it, I can't see it, where is it? So I changed the procedure written by my friend: (just change UINT to INT data) The specific code is as follows: use system; class test {static void main () {datetime t1 = datetime.now; cal (200000); DateTime T2 = DATETIME.NOW; TIMESPAN T = T2-T1; console.writeline ("time is: {0} millisecond / n", t.totalmilliseconds.tostring ()); console.readline ();} static void Cal INT x) {console.write ("2,"); int sum = 1; for (int A = 3; a This further shows that Java and .NET virtual machines are basically no difference in performing efficiency. The only reason for the first two programs produces difference is: C # Built-in supportless number Java only has a number of symbols Java's efficiency is on the environment where only the positive environment is required! Why does Java not built-in support "unsigned basic data type"? ? This allows us to write a network program, Byte is a symbol number, let us have to handle it, so as not to appear. It is highly recommended that Java has built-in support unsigned basic data types! I don't know what opinion is there? I hope to enlighten me!