visionmedia/express — pull request #2128 by ashi009 (2014-05-22 03:17:39+00:00)
Title: Replace buffer-crc32 to improve performance

As buffer-crc32 is used to calculate etag for each response, it's performance is
critical for express. buffer-crc32 is a Javascript CRC-32 implementation, which
could result in performance penalty due to the language it self.

I propose to use fast-crc32c to replace current CRC-32 implementation, as it may
use hardware acceleration when possible, and will gracefully fall back to js
implementation of CRC-32C whichs result is consistent with hardware accelerated
version.

Here is the benchmark result for different implementations

| res size | fast-crc32c hw | fast-crc32c js | buffer-crc32 | change |
| ---------:| ---------------:| ---------------:| -------------:| ------------- |
| 128B | 7883.30 req/s | 8153.78 req/s | 8100.85 req/s | -2.7% / 0.7% |
| 512B | 8099.78 req/s | 8112.71 req/s | 8022.18 req/s | 1.0% / 1.1% |
| 1024B | 7942.10 req/s | 8127.20 req/s | 7801.90 req/s | 1.8% / 4.2% |
| 2048B | 8030.10 req/s | 7837.05 req/s | 7613.33 req/s | 5.5% / 2.9% |
| 4096B | 7554.95 req/s | 7283.39 req/s | 6911.11 req/s | 9.3% / 5.4% |
| 16384 | 7205.52 req/s | 5623.53 req/s | 4860.64 req/s | 48.2% / 15.7% |
| 65536 | 5203.17 req/s | 1925.98 req/s | 2126.77 req/s | 144.7% / -9.4% |

and charted as
![screen shot 2014-05-22 at 10 45 54 am](https://cloud.githubusercontent.com/assets/687367/3049402/1eee873c-e15e-11e3-9864-6efbdf5e55dc.png)

[Scripts used for benchmark](https://gist.github.com/ashi009/294f125ade6f7a9e11cb)