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

Cache label textures separately from element textures #1270

Closed
maxkfranz opened this issue Feb 25, 2016 · 0 comments

Comments

Projects
None yet
2 participants
@maxkfranz
Copy link
Member

commented Feb 25, 2016

This will improve performance of texture caching when an element's body changes but its label remains the same

Depends on #2027

@maxkfranz maxkfranz added this to the 2.8.0 milestone Feb 25, 2016

@maxkfranz maxkfranz removed the enhancement label Apr 12, 2016

@maxkfranz maxkfranz modified the milestones: future, 3.2.0 Jan 16, 2017

@d2fong d2fong modified the milestones: 3.2.0, 3.3.0 Jun 7, 2017

maxkfranz added a commit that referenced this issue May 4, 2018

Element texture caching uses style property hashes
- Add hash unit tests.
- Make property groups : These are used for creating group hashes, as some properties don't visual output.
- Optimisation for style hash calculations : Calculate the hashes for property groups a more cheaply by only considering non-default prop values and iterating over the overridden  keys in `ele._private.style` rather than the entire group prop list.
- Pie style property hints use the property group hashes.
- Add `ElementTextureCacheLookup` : a lookup table for (ele, scaleLvl) tuples based on the style hashes.  If N elements share the same hash, then there is only one rendering with N blits -- blits being cheap and renderings being expensive.  This will help performance greatly on graphs with many nodes that are the same apart from label (once separate label textures are implemented #1270).
- The `ElementTextureCacheLookup` can be re-used for implementing separate caches for edge arrows #1616 and element labels #1270.
- Misc. formatting improvements to cache code and stylesheet code.

Completes:

- Port existing string-key caches to use an integer hash key #2028
- Use integer hash for style property hint keys #2027

maxkfranz added a commit that referenced this issue Sep 6, 2018

Add support for caching element labels separately from element bodies…
…. Squash merge label-texture feature branch:

- Parameterise the element texture cache with the key lookup and drawing functions.  This is currently used for element bodies and element labels.  It could also be applied to edge arrows.
- Store separate bounding boxes for the labels, element bodies, and edge arrows.  These bounds are necessary for using the element texture caches.
- Update the cached bounds shift strategy to take into account the sub-bounds.  Update the shift a bit more lazily so it's less ops per shift --- and only shift the individual values once per n-miss-1-get cycle.
- Caches within a texture are recoverable as long as the texture is not retired.  This reduces memory usage and increases execution speed.
- Fixes `ElementTextureCacheLookup` diffs.
- Updates to `ele.boundingBox()` docs.
- Increase the levels at which the element texture cache can operate to try to get more hits.

Refs:

- Cache element textures per style context stack #1337
- Cache label textures separately from element textures #1270
- Cache edge arrow textures separately #1616

@maxkfranz maxkfranz closed this Sep 6, 2018

maxkfranz added a commit that referenced this issue Nov 1, 2018

When invalidating the element textures for an element, the texture co…
…nsidered for retirement should be the one pointed to by the old (invalid) key rather than the current key.

Ref:
- Cache label textures separately from element textures #1270
- Use integer hash for style property hint keys #2027

maxkfranz added a commit that referenced this issue Nov 1, 2018

When a new stylesheet is applied to the graph,
- the style hints should be cleared for all elements and
- the bounds caches should be cleared for all elements.

Ref:
- Cache label textures separately from element textures #1270
- Use integer hash for style property hint keys #2027
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.