嫻嬭瘯鍗曞厓鐨勪唬鐮侊細
******************
@Test
public void deepCloneVsSerial() throws CloneNotSupportedException, IOException, ClassNotFoundException {
int max = 100000;
String manName = "Robert C. Martin";
int manAge = 40;
int teacherAge = 50;
String teacherName = "T1";
Teacher teacher = new Teacher(teacherName, teacherAge);
Man man = new Man(manName, manAge, teacher);
//begin
long start1 = System.currentTimeMillis();
for (int i = 0; i < max; i++) {
man.clone();
}
long end1 = System.currentTimeMillis();
System.err.println(max + " clone time:" + (end1 - start1));
long start2 = System.currentTimeMillis();
for (int i = 0; i < max; i++) {
man.serialClone();
}
long end2 = System.currentTimeMillis();
System.err.println(max + " serial clone time:" + (end2 - start2));
/**
* Every multiple in the array has a prime factor that
* is less than or equal to the root of the array size,
* so we don't have to cross of multiples of numbers
* larger than that root.
*/
]]>re: Advice about migrating to new platfrom http://www.tkk7.com/zhb8015/archive/2012/04/05/373193.html#373363qingyueqingyueThu, 05 Apr 2012 04:34:00 GMThttp://www.tkk7.com/zhb8015/archive/2012/04/05/373193.html#373363
]]>re: Advice about migrating to new platfrom http://www.tkk7.com/zhb8015/archive/2012/04/03/373193.html#373278tbtbTue, 03 Apr 2012 05:19:00 GMThttp://www.tkk7.com/zhb8015/archive/2012/04/03/373193.html#373278