# Inflate map sightline data with the browser's gzip on the web · dara/icarus

[View on GitCafe](https://git.cafe/dara/icarus/commit/2b20a0f2b703f972193151dd0a1d7354845198ed)

Repository: [dara/icarus](https://git.cafe/dara/icarus)

Visibility: public

Requested revision: 2b20a0f2b703f972193151dd0a1d7354845198ed

Requested commit: 2b20a0f2b703f972193151dd0a1d7354845198ed

Commit: 2b20a0f2b703f972193151dd0a1d7354845198ed

Tree: 850da46512d8797bb0f830dabc48667b1dbdf44f

Author: Dara Adedeji

Committer: Dara Adedeji

## Message

```
Inflate map sightline data with the browser's gzip on the web

Opening a map on the web froze the page for 0.6 to 1.7 s. Most of that
was the pure-Dart gzip inflate and CRC-32 from package:archive, which on
the web run on the UI thread (compute does not leave it there): about
0.4 s per side on Bind.

inflateWorldGzip now hands the bytes to the browser's DecompressionStream,
which inflates Bind's 19 MB side in about 50 ms. Desktop is unchanged: it
still calls decodeWorldGzip (native zlib) inside its background isolate.
Browsers without DecompressionStream (Firefox before 113, Safari before
16.4) also keep decodeWorldGzip.

The integrity contract holds. The browser rejects a wrong CRC-32 or
length, a stream cut before its footer, and bytes after it; the header
and the footer length are still checked here, and any failure is the
same FormatException as before. Navigation charts read through the same
function, so they get the same speedup.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

```

## Parents

- [0fca2d18bf98fa7a7119a14645cfde80c90ee540](https://git.cafe/dara/icarus/commit/0fca2d18bf98fa7a7119a14645cfde80c90ee540?format=markdown)

[Source at this commit](https://git.cafe/dara/icarus/tree/2b20a0f2b703f972193151dd0a1d7354845198ed?format=markdown)
