Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encoding/mvt: use protoscan for unmarshalling #57

Merged
merged 1 commit into from
Jan 16, 2021
Merged

Conversation

paulmach
Copy link
Owner

@paulmach paulmach commented Jan 9, 2021

Vector Tiles have an encoding for the geometry. This causes an intermediate state were the protobuf is unpacked into a []uint32 and then converted into the orb.Geometry types. This intermediate step can be removed by using a low lever decoder like protoscan

The behavior is the same, but the performance is substantially better:

benchmark                     old ns/op     new ns/op     delta
BenchmarkUnmarshal-12         367590        246198        -33.02%

benchmark                     old allocs     new allocs     delta
BenchmarkUnmarshal-12         6629           2476           -62.65%

benchmark                     old bytes     new bytes     delta
BenchmarkUnmarshal-12         372954        211681        -43.24%

benchmark                     old ns/op     new ns/op     delta
BenchmarkUnmarshal-12         367590        246198        -33.02%

benchmark                     old allocs     new allocs     delta
BenchmarkUnmarshal-12         6629           2476           -62.65%

benchmark                     old bytes     new bytes     delta
BenchmarkUnmarshal-12         372954        211681        -43.24%
@paulmach paulmach merged commit d655888 into master Jan 16, 2021
@paulmach paulmach deleted the protoscan-mvt branch January 16, 2021 23:29
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