Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Expensive GlyphAtlas bookkeeping #9157

Closed
jfirebaugh opened this issue May 31, 2017 · 0 comments · Fixed by #9213
Closed

Expensive GlyphAtlas bookkeeping #9157

jfirebaugh opened this issue May 31, 2017 · 0 comments · Fixed by #9213
Assignees
Labels
Core The cross-platform C++ core, aka mbgl performance Speed, stability, CPU usage, memory usage, or power usage

Comments

@jfirebaugh
Copy link
Contributor

After some basic optimization of the new diff-based style updates, about half of the time taken by RenderStyle::update during a "world tour" is spent in:

  10 Mapbox 18651000000.0  mbgl::Map::Impl::render(mbgl::View&)
   9 Mapbox 5436000000.0  mbgl::RenderStyle::update(mbgl::UpdateParameters const&)
   8 Mapbox 1446000000.0  mbgl::RenderVectorSource::update(mbgl::Immutable<mbgl::style::Source::Impl>, std::__1::vector<mbgl::Immutable<mbgl::style::Layer::Impl>, std::__1::allocator<mbgl::Immutable<mbgl::style::Layer::Impl> > > const&, bool, bool, mbgl::TileParameters const&)
   7 Mapbox 1408000000.0  mbgl::TilePyramid::update(std::__1::vector<mbgl::Immutable<mbgl::style::Layer::Impl>, std::__1::allocator<mbgl::Immutable<mbgl::style::Layer::Impl> > > const&, bool, bool, mbgl::TileParameters const&, mbgl::SourceType, unsigned short, mbgl::Range<unsigned char>, std::__1::function<std::__1::unique_ptr<mbgl::Tile, std::__1::default_delete<mbgl::Tile> > (mbgl::OverscaledTileID const&)>)
   6 Mapbox 1004000000.0  mbgl::TilePyramid::removeStaleTiles(std::__1::set<mbgl::OverscaledTileID, std::__1::less<mbgl::OverscaledTileID>, std::__1::allocator<mbgl::OverscaledTileID> > const&)
   5 Mapbox 973000000.0  mbgl::VectorTile::~VectorTile()
   4 Mapbox 972000000.0  mbgl::GeometryTile::~GeometryTile()
   3 Mapbox 699000000.0  mbgl::GlyphAtlas::removeGlyphs(mbgl::GlyphRequestor&)
   2 Mapbox 686000000.0  mbgl::GlyphAtlas::removeGlyphValues(mbgl::GlyphRequestor&, std::__1::map<char16_t, mbgl::GlyphAtlas::GlyphValue, std::__1::less<char16_t>, std::__1::allocator<std::__1::pair<char16_t const, mbgl::GlyphAtlas::GlyphValue> > >&)
   1 Mapbox 309000000.0  unsigned long std::__1::__hash_table<mbgl::GlyphRequestor*, std::__1::hash<mbgl::GlyphRequestor*>, std::__1::equal_to<mbgl::GlyphRequestor*>, std::__1::allocator<mbgl::GlyphRequestor*> >::__erase_unique<mbgl::GlyphRequestor*>(mbgl::GlyphRequestor* const&)
   0 Mapbox 290000000.0  std::__1::__hash_iterator<std::__1::__hash_node<mbgl::GlyphRequestor*, void*>*> std::__1::__hash_table<mbgl::GlyphRequestor*, std::__1::hash<mbgl::GlyphRequestor*>, std::__1::equal_to<mbgl::GlyphRequestor*>, std::__1::allocator<mbgl::GlyphRequestor*> >::find<mbgl::GlyphRequestor*>(mbgl::GlyphRequestor* const&)

We could optimize this by keeping an inverse of the current index, i.e. keep track of which glyphs are needed by each requestor.

@jfirebaugh jfirebaugh added Core The cross-platform C++ core, aka mbgl performance Speed, stability, CPU usage, memory usage, or power usage labels May 31, 2017
@jfirebaugh jfirebaugh self-assigned this Jun 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Core The cross-platform C++ core, aka mbgl performance Speed, stability, CPU usage, memory usage, or power usage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant