5月 092011
 

如下的遍历方式效率是比较低的:
1. 因为是用的迭代的方式,所以内存使用很少
2. 迭代的过程如下,效率是非常地的:
    sendto(3, "\310Q", 2, 0, NULL, 0)       = 2  (continue)
    recvfrom(3, "\0\0\0\0CTGT-MTI5NjI0OTk5MA==-130492"…, 65536, 0, NULL, NULL) = 72 (接收key)
    sendto(3, "\3100\0\0\0CTGT-MTI5NjI0OTk5MA==-13049"…, 73, 0, NULL, 0) = 73 (get key)
    recvfrom(3, "\0\0\0\0L{\"uid\":\"1296249990\",\"et\":13"…, 65536, 0, NULL, NULL) = 81  (接收value)

测试脚本:
 

 
  1. <?php
  2.         $tt = new TokyoTyrant();
  3.         $connected = $tt->connect($host$port);
  4.         $it = $tt->getIterator();
  5.         foreach ($it as $key=>$val) {
  6.         
  7.         } 
 Posted by at 下午 8:31

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

(required)

(required)

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据