-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(canyon-backend): add compress test
- Loading branch information
1 parent
8a91e2f
commit c2b27da
Showing
2 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 压缩的压缩率更高。 |