From 12a169e8ff4036e160dbdc605eb9f15eae933b47 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Thu, 19 Aug 2010 01:40:28 -0700 Subject: [PATCH] Add buffer_creation benchmark --- benchmark/buffer_creation.js | 6 ++++++ benchmark/string_creation.js | 6 ++++++ 2 files changed, 12 insertions(+) create mode 100644 benchmark/buffer_creation.js create mode 100644 benchmark/string_creation.js diff --git a/benchmark/buffer_creation.js b/benchmark/buffer_creation.js new file mode 100644 index 0000000..3901f04 --- /dev/null +++ b/benchmark/buffer_creation.js @@ -0,0 +1,6 @@ + + +for (var i = 0; i < 9000000; i++) { + b = new Buffer(10); + b[1] = 2 +} diff --git a/benchmark/string_creation.js b/benchmark/string_creation.js new file mode 100644 index 0000000..f2b5d2c --- /dev/null +++ b/benchmark/string_creation.js @@ -0,0 +1,6 @@ + + +for (var i = 0; i < 9000000; i++) { + s = '01234567890'; + s[1] = "a"; +} -- 2.7.4