-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
use handleid in renderer instead of a weak handle #4016
Conversation
Yes, I think this is reasonable. We can only have |
Moved the uuid to a u64 internally, but still kept the same api where you need to provide a Uuid on the derive because it's prettier... and I didn't want to change the derive macro without other opinions. This wins around 3 fps on |
Wow, that's way more than I expected. |
8455c37
to
c6f5189
Compare
3fps out of how many? :) Cool! |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In some places in the code, functions and such are still called 'uuid' which feels incorrect as uuid is something specific and this is not a uuid anymore.
Also, I haven't thought about the consequences and I'm imagining that @cart has. :)
Yup, before taking the step to yank all references and use of uuid, I was waiting for someone who may have ideas about unexpected consequences... and then, for the derive, having a uuid does look nicer than having a random u64... |
I think the asset type should keep using an uuid. A u64 is not enough to be almost certain that the type id's chosen by different plugins are globally unique across all plugins. If this is not the case, trying to use plugins with conflicting type id's will cause surprising and incorrect results that may be hard to debug. |
Nop, it panics. there is a check when adding a new asset type that panics if its ID is already registered, and the message should be explicit enough |
That will still prevent the plugins from being used at the same time. |
Neither uuid or u64 are a perfect solution to prevent collisions... and people will copy paste existing values from sample code |
Some assorted thoughts:
|
For context / cross-linking, this is the kinded entities idea from #1634. |
next question would be to replace the type uuid by a smaller unique id: uuid is backed by a u128, but a u64 would be largely enough to have a unique id for asset types, and make the
HandleId
enum the same size for both variants