{"id":50699634,"url":"https://github.com/ralscha/zopfli-go","last_synced_at":"2026-06-09T08:32:49.754Z","repository":{"id":348197600,"uuid":"1196799843","full_name":"ralscha/zopfli-go","owner":"ralscha","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-31T13:52:37.000Z","size":87,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-31T15:21:56.267Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ralscha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-31T03:47:28.000Z","updated_at":"2026-05-31T13:52:41.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ralscha/zopfli-go","commit_stats":null,"previous_names":["ralscha/zopfli-go"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ralscha/zopfli-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralscha%2Fzopfli-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralscha%2Fzopfli-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralscha%2Fzopfli-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralscha%2Fzopfli-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ralscha","download_url":"https://codeload.github.com/ralscha/zopfli-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralscha%2Fzopfli-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34098932,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-09T08:32:49.694Z","updated_at":"2026-06-09T08:32:49.746Z","avatar_url":"https://github.com/ralscha.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zopfli-go\n\n`zopfli-go` is a pure Go implementation of Zopfli-style compression for `gzip`, `zlib`, and raw `deflate` output.\n\n## Go Usage\n\n```go\npackage main\n\nimport zopfli \"github.com/ralscha/zopfli-go\"\n\nfunc main() {\n\tcompressed := zopfli.Gzip([]byte(\"hello, world\"))\n}\n```\n\nFor custom tuning, use `DefaultOptions()` and call `Compress` with `FormatGzip`, `FormatZlib`, or `FormatDeflate`.\n\n```go\npackage main\n\nimport zopfli \"github.com/ralscha/zopfli-go\"\n\nfunc main() {\n\toptions := zopfli.DefaultOptions()\n\toptions.NumIterations = 5\n\toptions.BlockSplittingMax = 8\n\n\tcompressed := zopfli.Compress(\u0026options, zopfli.FormatGzip, []byte(\"hello, tuned world\"))\n}\n```\n\n## CLI Usage\n\nThe repository includes a file-oriented CLI for precompressing web assets into adjacent `.gz` files.\n\n```bash\n./zopfli-go --help\n./zopfli-go --jobs 8 public\n./zopfli-go --include-suffix .js --exclude-suffix .min.js public\n./zopfli-go public assets/app.js\n./zopfli-go --json public\n```\n\nBehavior:\n\n- File and directory inputs are accepted.\n- Directories are walked recursively.\n- Outputs are written next to the source file as `filename.ext.gz`.\n- Files are skipped when the `.gz` output is larger than or equal to the original.\n- Existing `.gz` files are ignored as inputs unless `--allow-gzip-inputs` is set.\n\nSupported CLI flags:\n\n- `-j`, `--jobs`\n- `-i`, `--include-suffix` and `-x`, `--exclude-suffix` (repeatable, matched against relative paths or base filenames)\n- `--allow-gzip-inputs`\n- `-n`, `--iterations`\n- `--block-splitting`\n- `--block-splitting-last=false|true|both`\n- `--block-splitting-max`\n- `-v`, `--verbose`\n- `-V`, `--verbose-more`\n- `-J`, `--json`\n\n## Benchmarks\n\nThe table below is updated by the benchmark workflow on branch pushes and workflow dispatches.\n\nBenchmark comparisons use the original upstream Zopfli implementation from https://github.com/google/zopfli.\n\n\u003c!-- benchmark-summary:start --\u003e\n\n| Corpus | GoMs | PgoMs | CMs | PGO/Go | Go/C | PGO/C | GoBytes | CBytes | GzipBytes |\n| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |\n| mixed-256k | 2956.48 | 2830.11 | 7642.54 | 0.96 | 0.39 | 0.37 | 3162 | 3162 | 3204 |\n| random-256k | 434.12 | 423.88 | 403.26 | 0.98 | 1.08 | 1.05 | 262183 | 262183 | 262247 |\n| real-files-256k | 1073.41 | 1023.49 | 2579.72 | 0.95 | 0.42 | 0.40 | 4649 | 4649 | 5042 |\n| records-logs-256k | 1194.19 | 1119.80 | 2238.98 | 0.94 | 0.53 | 0.50 | 2510 | 2510 | 2662 |\n| tiny-text | 32.31 | 31.22 | 30.55 | 0.97 | 1.06 | 1.02 | 58 | 58 | 65 |\n| web-assets-256k | 1065.11 | 999.36 | 2318.37 | 0.94 | 0.46 | 0.43 | 3756 | 3756 | 4078 |\n\n\u003c!-- benchmark-summary:end --\u003e\n\n\n## Development\n\nRun the package tests with:\n\n```bash\ngo test ./...\n```\n\nGenerate the benchmark summary locally with:\n\n```bash\ngo run ./cmd/zopfli-task bench-summary\n```\n\n## Releases\n\nGitHub releases are produced by GoReleaser from version tags such as `v1.0.0`.\n\nRelease assets are archived as `.tar.gz` on Linux and macOS, and as `.zip` on Windows.\n\nThose release assets are consumed directly by `bread-compressor-cli` when its `--use-zopfli-go` flag is enabled.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fralscha%2Fzopfli-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fralscha%2Fzopfli-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fralscha%2Fzopfli-go/lists"}