Skip to content

Commit

Permalink
feat:not use lz4
Browse files Browse the repository at this point in the history
  • Loading branch information
qiang101.wang committed Sep 12, 2024
1 parent ee106bc commit d27bcf3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 4 additions & 2 deletions bin/wbc_lib.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
var lz4 = require('lz4');
const path = require('path');

//each part of header length
Expand Down Expand Up @@ -108,7 +107,10 @@ class Wbc {
generateBody(oriBody) {
let pointer = 0;
//use lz4 to compress quickJs bytecode
var bodyChunk = lz4.encode(oriBody);
//以后要压缩时直接放开使用,wbc的结构暂且不做变更,防止后面会使用其他的压缩算法减少bytecode的大小
// var bodyChunk = lz4.encode(oriBody);
// let length = BODY_LENGTH + BODY_CHUNK_TYPE + bodyChunk.length + BODY_CRC32;
var bodyChunk = oriBody;
let length = BODY_LENGTH + BODY_CHUNK_TYPE + bodyChunk.length + BODY_CRC32;
const bodyBuffer = Buffer.alloc(length);

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"bindings": "^1.5.0",
"commander": "^8.2.0",
"crc32": "^0.2.2",
"lz4": "^0.6.5",
"nan": "^2.15.0",
"node-addon-api": "^4.1.0",
"node-gyp": "^9.0.0",
Expand Down

0 comments on commit d27bcf3

Please sign in to comment.