diff --git a/package.json b/package.json index e41ea55c..0451699a 100755 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "migrate": "prisma migrate dev --schema ./packages/canyon-backend/prisma/schema.prisma", "preinstall": "node ./scripts/check.js", "prepare": "husky", - "format": "pnpm -r do-test" + "test": "pnpm -r do-test" }, "devDependencies": { "@commitlint/cli": "^19.5.0", diff --git a/packages/canyon-backend/test/utils/README.md b/packages/canyon-backend/test/utils/README.md index dad46c8b..1e479730 100644 --- a/packages/canyon-backend/test/utils/README.md +++ b/packages/canyon-backend/test/utils/README.md @@ -1,2 +1,30 @@ -# 压缩测试 +# Zstd+Protobuf 压缩与 Zstd 直接压缩比较 +安装pnpm、nodejs18以上版本后,执行以下命令: + +```bash +pnpm install +cd packages/canyon-backend +pnpm run do-test +``` + +## 一、压缩耗时 +- **Zstd+Protobuf 压缩**:13 ms +- **Zstd 直接压缩**:6 ms + +可以看出 Zstd 直接压缩在压缩耗时上更具优势。 + +## 二、压缩前大小 +两种压缩方式的压缩前大小均为 72971b。 + +## 三、压缩后大小 +- **Zstd+Protobuf 压缩**:9596b +- **Zstd 直接压缩**:11292b + +Zstd+Protobuf 压缩后的大小更小。 + +## 四、压缩率 +- **Zstd+Protobuf 压缩**:86.85% +- **Zstd 直接压缩**:84.53% + +Zstd+Protobuf 压缩的压缩率更高。