Skip to content
Browse files

fixes #6

  • Loading branch information...
1 parent ac0fef6 commit 848482b586c963e8f1f86f53f37ce72640f761b8 @olegp committed Jun 24, 2011
Showing with 3 additions and 3 deletions.
  1. +2 −2 README.md
  2. +1 −1 lib/binary.js
View
4 README.md
@@ -90,15 +90,15 @@ To run them and generate graphs, execute the following command:
This will generate PNG images of the graphs in `benchmarks/results/graphs/`. Some results are provided below:
- * [buffer-alloc](http://olegp.github.com/common-node/graphs/buffer-alloc.png)
+ * [buffer-alloc](http://olegp.github.com/common-node/graphs/buffer-alloc.png) - creates a number of byte arrays per request; the difference in performance compared to Node is due to the [array being cleared](https://github.com/olegp/common-node/issues/6)
* [hello-world](http://olegp.github.com/common-node/graphs/hello-world.png) - returns a dynamically generated string
* [no-alloc](http://olegp.github.com/common-node/graphs/no-alloc.png)
* [parse-json](http://olegp.github.com/common-node/graphs/parse-json.png)
* [set-timeout](http://olegp.github.com/common-node/graphs/set-timeout.png) - sleep for 100ms before returning a response
* [static-file](http://olegp.github.com/common-node/graphs/static-file.png) - returns a file served from the file system
* [string-alloc](http://olegp.github.com/common-node/graphs/string-alloc.png)
-As you can see from the results and given no profiling or optimization work has been so far, there's room for improvement.
+As you can see from the results and given no profiling or optimization work has been done so far, there's room for improvement.
Any patches or suggestions on how to improve performance would be greatly appreciated.
### Embedding
View
2 lib/binary.js
@@ -74,7 +74,7 @@ var ByteArray = exports.ByteArray = function() {
// ByteArray(length) - create ByteArray of specified size, but don't clear
else if (arguments.length === 2 && typeof arguments[0] === "number" && typeof arguments[1] === "boolean") {
this.buffer = new Buffer(arguments[0]);
- if(!arguments[1]) zero(this.buffer);
+ if(arguments[1] === true) zero(this.buffer);
}
// ByteArray(byteString or byteArray) - use the contents of byteString or byteArray
else if (arguments.length === 1 && (arguments[0] instanceof ByteString || arguments[0] instanceof ByteArray)) {

0 comments on commit 848482b

Please sign in to comment.
Something went wrong with that request. Please try again.