diff options
author | Bert Belder <bertbelder@gmail.com> | 2012-05-08 18:09:04 +0200 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2012-05-09 03:56:09 +0200 |
commit | 4ddafbd5633827b4e855472acebf4525c817e011 (patch) | |
tree | 1cbadf866408ac3608a02853ecf7e3786c6d0e72 /benchmark | |
parent | 7f68f256cfac319fba1c47f60f5aab008fbb170e (diff) | |
download | android-node-v8-4ddafbd5633827b4e855472acebf4525c817e011.tar.gz android-node-v8-4ddafbd5633827b4e855472acebf4525c817e011.tar.bz2 android-node-v8-4ddafbd5633827b4e855472acebf4525c817e011.zip |
Benchmark: add /unicode/nnn bench to http_simple.js
Diffstat (limited to 'benchmark')
-rw-r--r-- | benchmark/http_simple.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/benchmark/http_simple.js b/benchmark/http_simple.js index cc3ff8ee47..1b3cee7f4f 100644 --- a/benchmark/http_simple.js +++ b/benchmark/http_simple.js @@ -8,7 +8,8 @@ console.log('pid ' + process.pid); var fixed = makeString(20 * 1024, 'C'), storedBytes = {}, - storedBuffer = {}; + storedBuffer = {}, + storedUnicode = {}; var useDomains = process.env.NODE_USE_DOMAINS; @@ -60,6 +61,16 @@ var server = http.createServer(function (req, res) { } body = storedBuffer[n]; + } else if (command == 'unicode') { + var n = ~~arg; + if (n <= 0) + throw new Error('unicode called with n <= 0'); + if (storedUnicode[n] === undefined) { + console.log('create storedUnicode[n]'); + storedUnicode[n] = makeString(n, '\u263A'); + } + body = storedUnicode[n]; + } else if (command == 'quit') { res.connection.server.close(); body = 'quitting'; |