Feature Description
Currently, we have to do a bunch of bookkeeping and machinery for our disposal leases to ensure that they are not double-disposed (ie, make them copy-safe). This is currently implemented in runtime code.
I believe for this, we could achieve the same effect (make things copy-safe) by moving the checks into an extremely robust analyzer, to prevent copies from even happening in the source. This way, we have the same result (zero-cost disposals), HOWEVER, they are even faster, since they don't need the runtime machinery.
We should investigate/research this approach, and, if it has merit, do a sweep of the code base for where we have similar patterns - runtime machinery/bookkeeping that can be moved to compile time analyzers.
Use Case / Motivation
Faster hot paths, more safety, simpler code.
Proposed Solution
No response
Alternatives Considered
No response
Unity Version
None
Package Version
None
Feature Description
Currently, we have to do a bunch of bookkeeping and machinery for our disposal leases to ensure that they are not double-disposed (ie, make them copy-safe). This is currently implemented in runtime code.
I believe for this, we could achieve the same effect (make things copy-safe) by moving the checks into an extremely robust analyzer, to prevent copies from even happening in the source. This way, we have the same result (zero-cost disposals), HOWEVER, they are even faster, since they don't need the runtime machinery.
We should investigate/research this approach, and, if it has merit, do a sweep of the code base for where we have similar patterns - runtime machinery/bookkeeping that can be moved to compile time analyzers.
Use Case / Motivation
Faster hot paths, more safety, simpler code.
Proposed Solution
No response
Alternatives Considered
No response
Unity Version
None
Package Version
None