nlf/protobuf.js — pull request #14 by oleksiyk (2014-01-13 17:28:22+00:00)
Title: Simple performance comparison for copying binary data to array and to buffer

This is not a pull request to be merged, its a performance test for https://github.com/nlf/protobuf.js/issues/11

This is a dead simple performance comparison for copying large binary data:

1. by concatenating buffer with data to array
2. by copying buffer to preallocated buffer

On my machine the results are:

```
$ node perf/test.js
testWithBuffer: 1063.8297872340427 op/s
testWithArray: 19.76284584980237 op/s
````

Yes, we need to know the size of the buffer before copying but that shouldn't change results dramatically.