Access killkill
Http://blog.csdn.net/killlkilll/archive/2006/12/23/1457022.aspx
List <t> the value type operation does not require packing; arraylist is required.
Class Program
...{
Static void main (string [] ARGs)
...{
Stopwatch Sw = new stopwatch ();
Sw. Start ();
Ilist <somevaluetye> List = new list <somevaluetye> ();
For (INT I = 0; I <1000; I ++)
...{
List. Add (New somevaluetye (I, "test "));
}
Sw. Stop ();
Console. writeline (SW. elapsed );
Sw. Reset ();
Arraylist Al = new arraylist ();
For (INT I = 0; I <1000; I ++)
...{
Al. Add (New somevaluetye (I, "test "));
}
Sw. Start ();
Sw. Stop ();
Console. writeline (SW. elapsed );
Console. Readline ();
}
}
Struct somevaluetye
...{
Public int m_testint;
Public String m_teststr;
Public somevaluetye (INT intvalue, string strvalue)
...{
M_testint = intvalue;
M_teststr = strvalue;
}
}
Execution result:
00:00:00. 0022005
00:00:00. 0000296
This is not an order of magnitude difference.