-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Conversation
4e5162f
to
e1a300a
Compare
public: | ||
AnnotationTileFeatureData(const AnnotationID id_, | ||
FeatureType type_, | ||
GeometryCollection geometries_, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the reason this is not GeometryCollection && geometries_,
is that clang-tidy
claims that copying is faster here than explicitly asking for a move?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, just a leftover from a previous implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So do you think it should be GeometryCollection &&
to avoid the extra copy? If so, I presume that would require a separate refactor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great @kkaefer 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have any way to quantify the performance impact here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opted not to make GeometryTileFeature handles fully owning their data due to possible overhead of a shared_ptr
Since this reintroduces the implicit requirement that objects retaining a GeometryTileFeature
must also retain its owning GeometryTileLayer
, should we document that somewhere? I remember that when I was first working on #7939, this was not immediately obvious to me from scanning the code.
e1a300a
to
68822f3
Compare
This will fail due to mapbox/vector-tile#19 I added a benchmark and these are the results: before
after
|
Great to see these perf improvements @kkaefer 🎉 Can you tell if the improvements are due to addressing #9167 or due to the upgraded vector tile decoding code? If it is the latter I would suspect/hope that it is attributable to either how we now pre-allocate arrays for geometries or the new deferred parsing of feature values until accessed (rather than at layer parse). |
I ran Instruments, and it by far the dominating part is geometry parsing, and it looks like it's spending less time on that now. |
👍 @kkaefer I would recommend adding |
68822f3
to
b6728ea
Compare
Added |
👍 So, with |
We're storing GeometryTileFeature objects in SymbolLayout, but they may reference data in GeometryTileLayer, which could go away if we don't retain it.
b6728ea
to
988a855
Compare
This pull request replaces our custom vector tile parsing code with the vector-tile C++ library.
Addresses the problem in #9167 by changing the
GeometryTileData
interface to return owning handles toGeometryTileLayer
, which we can then retain inSymbolLayout
so that theSymbolFeature
handles don't end up with dangling handles. I opted not to makeGeometryTileFeature
handles fully owning their data due to possible overhead of ashared_ptr
./cc @springmeyer