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

[c] Optimized attachment lookup in skin. See #1117. #1118

Merged

Conversation

ievgenmukhin
Copy link
Contributor

No description provided.

@badlogic
Copy link
Collaborator

badlogic commented Jun 5, 2018

Sorry I haven't had time to merge this yet. Could I bother you to send us a scan or photo of the CLA? Otherwise we can't merge your PR. Sorry for the inconvenience.

While the solution is already quite simple (great job!), I wonder if we can make it even simpler. What if we bucket by slot index instead of calculating a murmur hash? That way, we could get rid of the hashing entirely, and just have an array of _SkinHashTableEntry which is indexed by the slot index instead of the murmur hash. My guess is that locality would actually be better.

If you want to make and test this change for your use case that'd be great, as we can directly compare performance to your murmur hash solution. Otherwise I'll try to get to this sometime this week.

@ievgenmukhin
Copy link
Contributor Author

I've update PR with your suggestions. Actually hash table distribution is better with murmur hash, but search works much slower with it (up to 2x on small spine files), probably because of time required for hash calculation. I got same search speed on large file with 8000 skin entries when hashtable size was increased to 1000 elements. I assume that with even more complex spine files and larger hashtable sizes murmur hash will start to work faster than your approach, but for most cases slot index is better.
I'll send you CLA via email.

@badlogic
Copy link
Collaborator

badlogic commented Jun 7, 2018

Thanks a lot, great work!

@badlogic badlogic merged commit cab8127 into EsotericSoftware:3.6 Jun 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants