Skip to content

fix: port pzip parallel compression to release/eagle for ARM64 ZIP performance (PMS 380503) - #550

Draft
LiHua000 wants to merge 1 commit into
linuxdeepin:release/eaglefrom
LiHua000:agent/bugfix/380503
Draft

LiHua000 wants to merge 1 commit into
linuxdeepin:release/eaglefrom
LiHua000:agent/bugfix/380503

Conversation

@LiHua000

Copy link
Copy Markdown
Contributor

PMS 380503: ARM64 平台 ZIP 压缩性能优化

问题描述

ARM64 平台压缩 2.5G 碎片化文件为 ZIP 格式时,速度比 KOS 慢 180-350%。

根因

release/eagle 分支(Qt5/KF5)未集成 pzip 高性能并行压缩工具。ARM64 平台 ZIP 压缩走 libarchive 单线程路径,性能远不如多线程并行压缩。

修复方案

从 master 分支移植 pzip 并行压缩功能到 release/eagle(Qt5/KF5)。

核心改动

  1. pzip 核心库 (src/pzip/): C++17, OpenSSL, ZLIB, 多线程并行 Deflate
  2. clipzipplugin (3rdparty/clipzipplugin/): Kerfuffle 插件, 优先级 200
  3. 构建系统: x86/ARM 环境启用 pzip + clipzipplugin
  4. uitools: 新增 APT_AutoWithoutPzip, 读取/解压时跳过 pzip
  5. archivemanager: ZIP 追加时排除 pzip (仅支持新建压缩)
  6. mainwindow: ARM64 ZIP 压缩使用 pzip (APT_Auto), 不再强制 libarchive

安全加固

  • 仅压缩不解压: 不构建 punzip-bin, 避免 symlink race 漏洞
  • 路径遍历防护: toZipPath() 移除 .. 路径组件, 防止 Zip Slip
  • 符号链接安全: file_task.cpp 使用 symlink_status() 不跟随符号链接
  • 读取/追加排除: pzip 仅用于新建压缩

自测结果

  • ✅ pzip 核心库编译通过 (g++ 12.3.0, C++17, OpenSSL 3.2.4, ZLIB 1.3.1)
  • ✅ 多文件压缩 (100 个 256KB 文件)
  • ✅ 多线程压缩 (4 线程 vs 1 线程, 文件列表一致)
  • ✅ 符号链接处理 (存储为符号链接, 不跟随)
  • ✅ 路径遍历防护 (.. 组件被移除)
  • ✅ 加密压缩 (WinZip AES-256)

关联

  • PMS: 380503
  • 分支: release/eagle
  • 移植来源: master (commit e2086f3)

@sourcery-ai

sourcery-ai Bot commented Nov 10, 2026

Copy link
Copy Markdown

Sorry @LiHua000, your pull request is larger than the review limit of 150,000 diff characters

@LiHua000
LiHua000 marked this pull request as draft November 10, 2026 02:38
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: LiHua000

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@LiHua000
LiHua000 force-pushed the agent/bugfix/380503 branch from ce344e9 to d24ab3d Compare November 10, 2026 03:25
…rformance

Bug: #380503

PMS 380503: ARM64 platform ZIP compression of 2.5G fragmented files 180-350% slower than KOS

Port pzip high-performance parallel compression from master to release/eagle (Qt5/KF5):
- pzip core library (src/pzip/): C++17, OpenSSL, ZLIB, multi-threaded parallel Deflate
- clipzipplugin (3rdparty/clipzipplugin/): Kerfuffle plugin, priority 200
- Build system: enable pzip + clipzipplugin on x86/ARM
- uitools: add APT_AutoWithoutPzip, skip pzip for read/extract
- archivemanager: exclude pzip for ZIP append (pzip only supports new compression)
- mainwindow: ARM64 ZIP compression uses pzip (APT_Auto) instead of libarchive

Security hardening:
- Only build pzip (compression), not punzip (extraction), avoiding symlink race
- toZipPath() removes '..' path components, preventing Zip Slip attack
- file_task.cpp uses symlink_status() to not follow symlinks
- Read/extract/append all exclude pzip plugin
@LiHua000
LiHua000 force-pushed the agent/bugfix/380503 branch from d24ab3d to e76b9cb Compare November 10, 2026 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants