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 edge arrow textures separately #1616

Closed
maxkfranz opened this issue Nov 22, 2016 · 0 comments
Closed

Cache edge arrow textures separately #1616

maxkfranz opened this issue Nov 22, 2016 · 0 comments
Labels
performance Improving speed and memory usage priority-1-high

Comments

@maxkfranz
Copy link
Member

maxkfranz commented Nov 22, 2016

For larger graphs with lots of arrows, the expense of drawing arrows is often greater than drawing the nodes now. This makes sense, because arrows are shapes very similar to node shapes -- but node textures get fully cached while edges only exist in layer caches (because of their larger size and because of the frequency of edge invalidations).

This would benefit from using a cache key other than the element ID. Using a hash of the arrow style would let it be re-used, as most edges will tend to have the same style.

The caches for arrows will have to be rotated and re-aligned to allow for re-usability.

Depends on #2027

@maxkfranz maxkfranz added the performance Improving speed and memory usage label Nov 22, 2016
@maxkfranz maxkfranz added this to the 3.2.0 milestone Nov 22, 2016
@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
- 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
…. 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 modified the milestones: 3.3.0, 3.4.0 Oct 4, 2018
@maxkfranz maxkfranz modified the milestones: 3.4.0, future Dec 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Improving speed and memory usage priority-1-high
Projects
None yet
Development

No branches or pull requests

2 participants