Speed of linkwalking

Mark Steele msteele at beringmedia.com
Tue Aug 30 10:31:01 EDT 2011

Hi folks,

Just want to know if I'm doing something obviously dumb here.

First the (PHP) code (Sorry of the API is different from the official API,
we're using a heavily modified version):

$obj1 = $bucket->newObject('linkkey1', array('link1'));
$obj2 = $bucket->newObject('linkkey2', 'dataforlinkkey2');

$start = microtime(true);
$blargh = $bucket->get('linkkey2');
$end = microtime(true);
printf("Took : %04f\n",$end - $start);

$start = microtime(true);
 $result =
    $client->add($bucketname, 'linkkey1')->
    map(array("riak_kv_mapreduce", "map_object_value")) ->
  foreach ($result as $data) {
$end = microtime(true);
printf("Took : %04f\n",$end - $start);

So here's what I'm seeing:

The simple key fetch takes 0.000661 seconds to execute, whereas the
link-walk takes 0.042043. Ouch. Quite a bit slower. Any ways to speed this


Mark Steele
Bering Media Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20110830/773058ac/attachment.html>

More information about the riak-users mailing list