Skip to content

Calculate our own bbox - #290

Merged
orangejulius merged 1 commit into
masterfrom
calculate-bbox
Sep 22, 2026
Merged

orangejulius merged 1 commit into
masterfrom
calculate-bbox

Conversation

@orangejulius

@orangejulius orangejulius commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

The method we used to use, as part of @mapbox/geojson-extent, used a library called traverse that spent a bunch of time per record doing a bunch of extra work, copying data around, etc.

Calculating a bbox for a linestring is easy and just requires looping once through every point and recording 4 min and max values, so now we do it ourselves.

While the polylines importer is generally not the slowest part of a large build, this simple change almost doubles importer throughput!

As a bonus we get to remove an old dependency that hasn't been published in a few years.

The method we used to use, as part of `@mapbox/geojson-extent` used a
library called traverse that spent a bunch of time per record
doing a bunch of extra work, copying data around, etc.

Calculating a bbox for a linestring is easy and just requires looping
once through every point iand recording 4 min and max values, so now we
do it ourselves.

While the `polylines` importer is generally not the slowest part of a
large build, this simple change almost doubles importer throughput!

As a bonus we get to remove an old dependency that hasn't been published
in a few years.
@orangejulius orangejulius changed the title feat(parser): Calculate our own bbox Calculate our own bbox Sep 21, 2026
@orangejulius
orangejulius merged commit af3cfb6 into master Sep 22, 2026
6 checks passed
@orangejulius
orangejulius deleted the calculate-bbox branch September 22, 2026 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant