[Pkg-javascript-commits] [node-leveldown] 253/492: Merge branch 'gruber-inspired-batch-optimisation' into 0.2-wip

Andrew Kelley andrewrk-guest at moszumanska.debian.org
Sun Jul 6 17:14:06 UTC 2014


This is an automated email from the git hooks/post-receive script.

andrewrk-guest pushed a commit to annotated tag rocksdb-0.10.1
in repository node-leveldown.

commit 6fc9b05ef78506473beb0d8522f2999ca655f473
Merge: fa2c239 4815aac
Author: Rod Vagg <rod at vagg.org>
Date:   Wed Mar 13 16:08:19 2013 +1100

    Merge branch 'gruber-inspired-batch-optimisation' into 0.2-wip

 binding.gyp           |  1 -
 src/async.cc          |  1 -
 src/batch.cc          | 31 --------------------------
 src/batch.h           | 62 ---------------------------------------------------
 src/database.cc       | 28 ++++++++++++-----------
 src/database_async.cc | 23 +++++++++----------
 src/database_async.h  |  7 +++---
 7 files changed, 30 insertions(+), 123 deletions(-)

diff --cc src/database.cc
index 855947e,4b943aa..d5060b4
--- a/src/database.cc
+++ b/src/database.cc
@@@ -327,25 -330,23 +330,23 @@@ v8::Handle<v8::Value> Database::Batch (
      LD_CB_ERR_IF_NULL_OR_UNDEFINED(keyBuffer, key)
  
      if (obj->Get(str_type)->StrictEquals(str_del)) {
 -      LD_STRING_OR_BUFFER_TO_SLICE(key, keyBuffer, Key)
 +      LD_STRING_OR_BUFFER_TO_SLICE(key, keyBuffer)
  
-       operations->push_back(new BatchDelete(
-           key
-         , v8::Persistent<v8::Value>::New(keyBuffer)
-       ));
+       batch->Delete(key);
+       if (node::Buffer::HasInstance(keyBuffer->ToObject()))
+         references->push_back(v8::Persistent<v8::Value>::New(keyBuffer));
      } else if (obj->Get(str_type)->StrictEquals(str_put)) {
        v8::Local<v8::Value> valueBuffer = obj->Get(str_value);
        LD_CB_ERR_IF_NULL_OR_UNDEFINED(valueBuffer, value)
  
 -      LD_STRING_OR_BUFFER_TO_SLICE(key, keyBuffer, Key)
 -      LD_STRING_OR_BUFFER_TO_SLICE(value, valueBuffer, Value)
 +      LD_STRING_OR_BUFFER_TO_SLICE(key, keyBuffer)
 +      LD_STRING_OR_BUFFER_TO_SLICE(value, valueBuffer)
  
-       operations->push_back(new BatchWrite(
-           key
-         , value
-         , v8::Persistent<v8::Value>::New(keyBuffer)
-         , v8::Persistent<v8::Value>::New(valueBuffer)
-       ));
+       batch->Put(key, value);
+       if (node::Buffer::HasInstance(keyBuffer->ToObject()))
+         references->push_back(v8::Persistent<v8::Value>::New(keyBuffer));
+       if (node::Buffer::HasInstance(valueBuffer->ToObject()))
+         references->push_back(v8::Persistent<v8::Value>::New(valueBuffer));
      }
    }
  

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-leveldown.git



More information about the Pkg-javascript-commits mailing list