Skip to content

Instantly share code, notes, and snippets.

@tamaina
Last active May 9, 2026 14:01
Show Gist options
  • Select an option

  • Save tamaina/6ad118482177dc7b85fc7f92c0697663 to your computer and use it in GitHub Desktop.

Select an option

Save tamaina/6ad118482177dc7b85fc7f92c0697663 to your computer and use it in GitHub Desktop.
CoZip 0.0.1をベンチマークしてみた
Param( $PathTarget )
$Path7z = "C:\Program Files\7-Zip\7z.exe"
$7zMisskeyMx9Zip = Measure-Command {
Start-Process -FilePath "$Path7z" -ArgumentList "a bench.7z_mx9.zip `"$PathTarget`" -mx=9 -mmt=on" -Wait
}
$7zMisskeyMx1Zip = Measure-Command {
Start-Process -FilePath "$Path7z" -ArgumentList "a bench.7z_mx1.zip `"$PathTarget`" -mx=1 -mmt=on" -Wait
}
$7zMisskeyMx97z = Measure-Command {
Start-Process -FilePath "$Path7z" -ArgumentList "a bench.7z_mx9.7z `"$PathTarget`" -mx=9 -mmt=on" -Wait
}
$7zMisskeyMx17z = Measure-Command {
Start-Process -FilePath "$Path7z" -ArgumentList "a bench.7z_mx1.7z `"$PathTarget`" -mx=1 -mmt=on" -Wait
}
Write-Host "to Zip, 7z, -mx=9 ...... $([Math]::Round($7zMisskeyMx9Zip.TotalSeconds, 3, [MidpointRounding]::AwayFromZero))s $([Math]::Round((Get-Item "bench.7z_mx9.zip").Length / 1MB, 2, [MidpointRounding]::AwayFromZero))MB"
Write-Host "to Zip, 7z, -mx=1 ...... $([Math]::Round($7zMisskeyMx1Zip.TotalSeconds, 3, [MidpointRounding]::AwayFromZero))s $([Math]::Round((Get-Item "bench.7z_mx1.zip").Length / 1MB, 2, [MidpointRounding]::AwayFromZero))MB"
Write-Host "to 7z, 7z, -mx=9 ...... $([Math]::Round($7zMisskeyMx97z.TotalSeconds, 3, [MidpointRounding]::AwayFromZero))s $([Math]::Round((Get-Item "bench.7z_mx9.7z").Length / 1MB, 2, [MidpointRounding]::AwayFromZero))MB"
Write-Host "to 7z, 7z, -mx=1 ...... $([Math]::Round($7zMisskeyMx17z.TotalSeconds, 3, [MidpointRounding]::AwayFromZero))s $([Math]::Round((Get-Item "bench.7z_mx1.7z").Length / 1MB, 2, [MidpointRounding]::AwayFromZero))MB"

GPUでZip(Deflate)圧縮ができるCoZip(https://github.com/bea4dev/cozip)が話題になっていたため、ベンチマークをしてみました。

対象ファイル

世間で広く流通している画像ファイル(png, jpeg)やMS Office 2007以降のファイル(xlsx, docx)はすでに圧縮がかかっているため、あまり意味がありません。
勿論これらのファイルをzipにしてやりとりすることはありますから、尚サイズが減ったり逆にオーバーヘッドによるサイズ増がないことが望ましくはありますが、ここでは扱いません。

バイナリでもいいですが、テキストファイルやテキストファイルが多めのフォルダが相応しいかと思います。

今回は、50MB程度のMisskeyのソースコードフォルダと、日本語版Wikipediaのすべての記事を1つのファイルに集めたもの(19GB)との2つを選定しました。

ハードウェア

Windows 11 Home 25H2 Insider Preview Build 26220.8340
Intel Core i7-10510U (4C8T, 1.80GHz)
DDR4 SODIMM 16GB 2667MHz (1スロット)
NVIDIA GeForce MX250 (VRAM2GB)

古い微妙なスペックのノートパソコンでの検証です。

ソフトウェア

7zip v26.01

-mmt=on
PowerShellスクリプトでMeasure-Commandによる計測

CoZip 0.0.1

並列読み込みのスレッド数: 8
zip: Hybrid, PDeflate: GPU有効
目視でストップウォッチ計測

ベンチマーク

Misskeyソースコード v2026.5.1

https://github.com/misskey-dev/misskey/archive/refs/tags/2026.5.1.zip
ファイル数: 2,988、フォルダー数: 263

misskey-2026.5.1 46.73MiB / tar: 49.04MiB

to Zip, 7z, -mx=9 ......  8.11s 27.14MiB
to Zip, CoZip, Lv9 ..... 12.20s 27.95MiB
to Zip, 7z, -mx=1 ......  1.03s 28.05MiB
to Zip, CoZip, Lv1 ..... 12.08s 36.3MiB
to 7z,  7z, -mx=9 ......  8.07s 23.34MiB
to 7z,  7z, -mx=1 ......  2.04s 25.38MiB
tp CoZip, ハフマン=off .....  2.11s 45.94MiB
to CoZip, ハフマン=on  .....  2.15s 46.16MiB

日本語版Wikipediaダンプ

https://dumps.wikimedia.org/jawiki/latest/?
jawiki-latest-pages-articles.xml.bz2 (01-May-2026 22:20)

19GB(18716.58MiB)のxmlファイルをそのまま圧縮。 mx=9/Lv9は時間がかかりすぎたためスキップ。

to Zip, 7z, -mx=1 ...... 412.97s  6107.02MiB
to 7z,  7z, -mx=1 ...... 340.27s  5088.90MiB
to Zip, CoZip, Lv1 .....  95.81s  9898.76MiB
to CoZip, ハフマン無効 .....  55.68s 18633.79MiB
to CoZip, ハフマン有効 .....  57.10s 18636.83MiB

結論

今回のベンチマークにおいては、CoZipでの圧縮は、今のところ良いところがないと言わざるを得ません。
唯一、Wikipediaダンプでは7zipに対して1/4程度の時間で圧縮が完了したものの、ファイルサイズはまあまあ大きくなってしまいました。

とくにPDefrate(.cozip)は何を圧縮しているのかわからないです(おそらくバグでしょうけれど)。

Web開発者の私としては、CoZipはGPU処理がWebGPU用のシェーダー言語(wgsl)で書かれており、ブラウザで高速にDeflate圧縮を行えるのではと期待しているので、引き続きウォッチしていきたいと考えています。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment