Skip to content

encoding/mvt: use protoscan for unmarshalling#57

Merged
paulmach merged 1 commit intomasterfrom
protoscan-mvt
Jan 16, 2021
Merged

encoding/mvt: use protoscan for unmarshalling#57
paulmach merged 1 commit intomasterfrom
protoscan-mvt

Conversation

@paulmach
Copy link
Copy Markdown
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