2009年6月10日

函数调用太快了

摘要: 在至强服务器上,使用 febird/vcproj/test_trb 测试 trb。结果发现使用compare函数指针的find仅比直接比较快17%!我原本以为至少要快一倍,因为在Windows(PentiumM Dual Core)上,直接比较的版本要快80%左右。经过测试,发现:现代Cpu的流水线真强! long long t32 = pf.current(); for (int i = 0, n=cc; i < n; ++i) { KeyType x = i + 100, y = i & 0xFFF; int cmp = vslow.p... 阅读全文

posted @ 2009-06-10 19:55 能发波 阅读(189) 评论(0) 推荐(0)

导航