Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-02-02 03:40:10 +0400
committerBen Noordhuis <info@bnoordhuis.nl>2013-02-02 04:01:42 +0400
commitcd42f56178c929da84046e750b9306b5656e3144 (patch)
tree927446d08728f20c4d8852aca0a7e59117277829 /src/node_buffer.h
parent916aebabb83745dd7b1402a92f120107fa6ea6b6 (diff)
buffer: optimize Buffer.prototype.write(s, 'hex')
Move the implementation to C++ land. This is similar to commit 3f65916 but this time for the write() function and the Buffer(s, 'hex') constructor. Speeds up the benchmark below about 24x (2.6s vs 1:02m). var s = 'f'; for (var i = 0; i < 26; ++i) s += s; // 64 MB Buffer(s, 'hex');
Diffstat (limited to 'src/node_buffer.h')
-rw-r--r--src/node_buffer.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/node_buffer.h b/src/node_buffer.h
index 27991fcfc07..5743f9b2618 100644
--- a/src/node_buffer.h
+++ b/src/node_buffer.h
@@ -124,6 +124,7 @@ class NODE_EXTERN Buffer: public ObjectWrap {
static v8::Handle<v8::Value> AsciiWrite(const v8::Arguments &args);
static v8::Handle<v8::Value> Utf8Write(const v8::Arguments &args);
static v8::Handle<v8::Value> Ucs2Write(const v8::Arguments &args);
+ static v8::Handle<v8::Value> HexWrite(const v8::Arguments &args);
static v8::Handle<v8::Value> ReadFloatLE(const v8::Arguments &args);
static v8::Handle<v8::Value> ReadFloatBE(const v8::Arguments &args);
static v8::Handle<v8::Value> ReadDoubleLE(const v8::Arguments &args);