First of all, I would like to thank you for providing the HTML dumps of Wikipedia and Wiktionary. These dumps make it much easier to parse and process the content in Python.
I currently use the Wikipedia and Wiktionary snapshots to create MDD dictionaries for use with GoldenDict-ng. I would like to offer a small suggestion, which you may already be aware of.
At present, the dumps are distributed in the .tar.gz format (for example, enwiki_namespace_0.tar.gz and enwiktionary_namespace_0.tar.gz). While GZIP is a mature and widely supported compression format, it is also relatively old and has certain performance limitations.
In recent years, the Zstandard (ZSTD) compression format, developed by Facebook, has gained significant adoption for large-scale data distribution. ZSTD provides:
- a higher compression ratio,
- faster compression and decompression speeds.
- This is due to its built-in support for parallel processing.
I hope that the team consider using ZSTD format as an alternative to GZIP.
Thank you very much for your time and consideration. I am at your disposal for any further questions.
See also T324954: Provide zstd compression algorithm for dumps for XML dumps.
Update 1: Python 3.14 added ZSTD to the standard library. To illustrate the benefits of using ZSTD to the Product and Engineering teams, I tested GZIP and ZSTD on my laptop. To have a fair comparison, I use the default simplest configuration. The result is
P:\Personal Projects\Dicts\Wiktionary - October 2025>C:\Users\Akira\anaconda3\envs\myenv\python.exe "P:\Personal Projects\Dicts\Wiktionary - October 2025\test.py" The size of chunk_0.tar is 2048 megabytes. The running time of gzip compressor is 62 seconds. The size of chunk_0.tar.gz is 248 megabytes. The running time of zstd compressor is 4 seconds. The size of chunk_0.tar.zst is 168 megabytes.
As you can see, ZSTD offers superior compression ratio and compression speed. Due to built-in parallel processing, the benefits will be even greater on Wikimedia high-performance mainframes with many CPU cores. I attach the Python script for your reference.
Have a nice Christmas and happy new year!
from compression import gzip, zstd from pathlib import Path import time, shutil outDir = r"E:\Personal Projects\tmp" outDir = Path(outDir) inTar = outDir / "chunk_0.tar" gzipDir = outDir / "chunk_0.tar.gz" zstdDir = outDir / "chunk_0.tar.zst" print("The size of chunk_0.tar is", round(inTar.stat().st_size/1024/1024), "megabytes.") print() start = time.perf_counter() with open(inTar, 'rb') as f: with gzip.open(gzipDir, 'wb') as g: shutil.copyfileobj(f, g) end = time.perf_counter() print("The running time of gzip compressor is", round(end-start), "seconds.") print("The size of chunk_0.tar.gz is", round(gzipDir.stat().st_size/1024/1024), "megabytes.") start = time.perf_counter() with open(inTar, 'rb') as f: with zstd.open(zstdDir, 'wb') as g: shutil.copyfileobj(f, g) end = time.perf_counter() print() print("The running time of zstd compressor is", round(end - start), "seconds.") print("The size of chunk_0.tar.zst is", round(zstdDir.stat().st_size/1024/1024), "megabytes.")
Update 2: I have tested the compression time when varying the number of threads:
The Python script is
from compression import zstd from pathlib import Path import shutil, time import matplotlib.pyplot as plt outDir = r"E:\Personal Projects\tmp" outDir = Path(outDir) inTar = outDir / "chunk_0.tar" zstdDir = outDir / "chunk_0.tar.zst" cores = [] times = [] ratios = [] for nCore in range(1, 5): if zstdDir.exists(): zstdDir.unlink() start = time.perf_counter() options = { zstd.CompressionParameter.nb_workers: nCore, } with open(inTar, 'rb') as f, zstd.open(zstdDir, 'wb', options=options) as g: shutil.copyfileobj(f, g) end = time.perf_counter() runtime = end - start ratio = zstdDir.stat().st_size / inTar.stat().st_size cores.append(nCore) times.append(runtime) ratios.append(ratio) fig, ax1 = plt.subplots() ax1.set_xlabel("Number of threads") ax1.set_ylabel("Runtime (seconds)") ax1.plot(cores, times, marker="o") #ax2 = ax1.twinx() #ax2.set_ylabel("Compression ratio") #ax2.plot(cores, ratios, marker="s") plt.title("Zstandard Compression: Threads vs Performance") plt.tight_layout() plt.show()
