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

Expensive GlyphAtlas bookkeeping #9157

Closed

Description

@jfirebaugh

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.

Activity

  1. added
    Core
    performance
    on May 31, 2017
  2. self-assigned this
    on Jun 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Coreperformance

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions