Skip to content

Commit

Permalink
perf: replace sse4_crc32 to @node-rs/crc32
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed May 6, 2020
1 parent 5b2917d commit 8bdb154
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
4 changes: 4 additions & 0 deletions benchmark/index.js
Expand Up @@ -3,6 +3,10 @@ const Benchtable = require('benchtable');
const suite = new Benchtable();

const kTesters = [{
name: '@node-rs/crc32c',
calculate: require('../impls/sse4_crc32c').calculate,
},
{
name: 'sse4_crc32c_hw',
calculate: require('sse4_crc32').sse42_crc,
}, {
Expand Down
4 changes: 2 additions & 2 deletions impls/sse4_crc32c.js
@@ -1,5 +1,5 @@
const sse4_crc32 = require('sse4_crc32');
const bindings = require('@node-rs/crc32');

module.exports = {
calculate: sse4_crc32.calculate,
calculate: bindings.crc32c,
};
5 changes: 3 additions & 2 deletions package.json
Expand Up @@ -10,7 +10,7 @@
},
"main": "./loader",
"optionalDependencies": {
"sse4_crc32": "^6.0.1"
"@node-rs/crc32": "^0.1.7"
},
"scripts": {
"test": "nyc --reporter=html --reporter=text mocha",
Expand All @@ -32,6 +32,7 @@
"mocha": "^6.2.1",
"nyc": "^14.1.1",
"random-string": "^0.2.0",
"should": "^13.2.3"
"should": "^13.2.3",
"sse4_crc32": "^6.0.1"
}
}
19 changes: 19 additions & 0 deletions yarn.lock
Expand Up @@ -89,6 +89,20 @@
lodash "^4.17.13"
to-fast-properties "^2.0.0"

"@node-rs/crc32@^0.1.7":
version "0.1.7"
resolved "https://registry.npmjs.org/@node-rs/crc32/-/crc32-0.1.7.tgz#dccb2147fda92d480ac3f89eac5ae4b5b77de4be"
integrity sha512-5wyTLS1zrpi5CmBZplbgIUt5mrQr+aCYo8DhBKYaTi0DzdpxMzxFfUOwxXRp6e5cLhaNdX6jk2KYrtysPi66/g==
dependencies:
"@node-rs/helper" "^0.1.3"

"@node-rs/helper@^0.1.3":
version "0.1.3"
resolved "https://registry.npmjs.org/@node-rs/helper/-/helper-0.1.3.tgz#da94032fe44bb6a3456d81de1bcdcead1f651817"
integrity sha512-jqJ8VRRoZDyEcW7cfVintp1qytoOXJkJpMj2pBgMgyGsipWDG5USGR98iDmDDqrcB0LUhOA1xsDuEpJgUYgSzA==
dependencies:
tslib "^1.11.1"

ajv@^6.5.5:
version "6.10.2"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52"
Expand Down Expand Up @@ -1642,6 +1656,11 @@ tough-cookie@~2.4.3:
psl "^1.1.24"
punycode "^1.4.1"

tslib@^1.11.1:
version "1.11.2"
resolved "https://registry.npmjs.org/tslib/-/tslib-1.11.2.tgz#9c79d83272c9a7aaf166f73915c9667ecdde3cc9"
integrity sha512-tTSkux6IGPnUGUd1XAZHcpu85MOkIl5zX49pO+jfsie3eP0B6pyhOlLXm3cAC6T7s+euSDDUUV+Acop5WmtkVg==

tunnel-agent@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
Expand Down

0 comments on commit 8bdb154

Please sign in to comment.