zhb8015

posts(23) comments(6) trackbacks(0)
  • BlogJava
  • 联系
  • RSS 2.0 Feed 聚合
  • 管理

常用链接

  • 我的随笔
  • 我的评论
  • 我的参与
  • 最新评论

留言簿

  • 给我留言
  • 查看公开留言
  • 查看私人留言

随笔分类

  • hadoop

随笔档案

  • 2013年3月 (1)
  • 2012年10月 (2)
  • 2012年8月 (2)
  • 2012年7月 (1)
  • 2012年6月 (1)
  • 2012年5月 (1)
  • 2012年4月 (5)

文章分类

  • arithmetc
  • books(2)
  • design patter(4)
  • English(1)
  • exception(3)
  • hadoop(1)
  • interview(53)
  • Kent Beck
  • linux,unix(1)
  • MartinFlow(7)
  • method(7)
  • middleware(1)
  • projectManagement(6)
  • soa(9)
  • ssh(14)
  • ThoughtWork(2)
  • tibco(13)

文章档案

  • 2013年4月 (1)
  • 2013年3月 (3)
  • 2012年8月 (1)
  • 2012年7月 (8)
  • 2012年6月 (15)
  • 2012年5月 (14)
  • 2012年4月 (22)
  • 2012年3月 (5)

相册

  • java

搜索

  •  

最新评论

  • 1. re: Log4j详细配置(转)
  • 写得很详细,最后那句好像有点小问题,输出到test1和stdout应该是log4j.logger.myTest1=DEBUG, test1, stdout ?
  • --aramxiao
  • 2. re: 结合Maven2进行J2EE项目构建(转)
  • 评论内容较长,点击标题查看
  • --最代码
  • 3. re: java深浅复制
  • 评论内容较长,点击标题查看
  • --zhb8015
  • 4. re: 求质数,难以理解的代码,有兴趣可以看一下
  • 评论内容较长,点击标题查看
  • --zhb8015
  • 5. re: Advice about migrating to new platfrom
  • platfrom or platform??
  • --qingyue

阅读排行榜

评论排行榜

我的评论

re: 通过面试再来看我平时的学习~~~ zhb8015 2012-10-15 11:12  
楼主总结的不错,相信这样持续的总结下去会收获不少。自己也存在这样的毛病,只有好好梳理了,东西才是自己的。
re: java深浅复制 zhb8015 2012-04-13 15:24  
补充一下:
七、性能测试:
测试结果:复制100000 克隆复制是串行化复制的74倍
100000 clone time:47
100000 serial clone time:3500
Multiple is(serial/clone):74

测试单元的代码:
******************
@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));

System.err.println("Multiple is(serial/clone):" + (end2 - start2)/(end1 - start1));
/**
* 100000 clone time:47
100000 serial clone time:3438
Multiple is(serial/clone):73
*/
}

******************
re: 求质数,难以理解的代码,有兴趣可以看一下 zhb8015 2012-04-12 17:52  
Robert C. Martin's explation:


/**
* 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.
*/
 
Powered by:
BlogJava
Copyright © zhb8015