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

Remove use of NSHashTable for interface state delegates #trivial #1122

Merged
merged 5 commits into from
Sep 17, 2018

Conversation

Adlai-Holler
Copy link
Member

@Adlai-Holler Adlai-Holler commented Sep 17, 2018

  • An empty hash table takes 2 heap allocations at 288 bytes.
  • 2 hash tables per node (original and copy for safe enumeration) is 576 bytes per node.
  • ASDisplayNode is only 928 bytes, so these hash tables add 60% more weight.
  • Most of these blocks are global blocks (no value capture, free retain/release) and some are stack blocks. No malloc blocks.

@@ -75,6 +75,7 @@ AS_EXTERN NSString * const ASRenderingEngineDidDisplayNodesScheduledBeforeTimest
#define TIME_DISPLAYNODE_OPS 0 // If you're using this information frequently, try: (DEBUG || PROFILE)

#define NUM_CLIP_CORNER_LAYERS 4
#define MAX_INTERFACE_STATE_DELEGATES 4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most nodes don't need more than 4 delegates, but there should be an API to increase it. That way users can do so without changing the framework.

@TextureGroup TextureGroup deleted a comment Sep 17, 2018
@Adlai-Holler Adlai-Holler merged commit 9bcafef into master Sep 17, 2018
@Adlai-Holler Adlai-Holler deleted the AHNoDelegateHashTable branch September 17, 2018 21:29
mikezucc pushed a commit to mikezucc/Texture that referenced this pull request Oct 2, 2018
…tureGroup#1122)

* Remove use of NSHashTable for interface state delegates #trivial

* Stray line

* One more case

* Add code to let people have more delegates

* Do it more
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants