lukeed / lukeed/polka

Unclear why brotli is disabled by default

Open
#223 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
5.6k
Forks
176
PR merge metrics
No merged PRs in 30d

Description

Hi,

I see that the [documentation](https://github.com/lukeed/polka/tree/02cbdb529ddca0a9f3d225e2abb2931924219cc3/packages/compression#optionsbrotli) states:

> Brotli incurs more performance overhead than Gzip, which is why it's not enabled by default.

But looking at most files on https://quixdb.github.io/squash-benchmark/ (e.g. `plrabn12.txt` on `s-desktop`), that doesn’t seem to be the case at what polka states to be their default settings (6 for both, although [Brotli’s documentation](https://www.brotli.org/encode.html#a8d0) says the default is 11). Alternatively, https://github.com/powturbo/TurboBench finds that on their corpus, `brotli -q 4` compresses faster than `gzip -6` and still denser than `gzip -9`. Is it perhaps the case that Brotli was disabled in polka based on its speed at `-q 11` being mistaken for its speed at `-q 6`?

(Disclaimer: I happen to work at Google on the team that originated Brotli before I joined, but I am writing this in my personal capacity. Working with them just happens to have sensitised me to the popular misconception that Brotli is inherently slow.)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the documentation at packages/compression#optionsbrotli and compare its stated defaults and performance rationale with the benchmark links in the issue. Verify whether the explanation accurately reflects Polka’s behavior, then clarify the documentation; done when the reason Brotli is disabled by default is unambiguous.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.