Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
100 SC require 10KB GC Alloc
#2
Of course the SplineController is persistent at runtime. The 100 bytes allocation are split by

a.) a check whether an event is bound to OnControlPointReached, 20 bytes, no way to improve that unless Unity opens up their API (VOTE here to support this!)
b.) once the event is bound, an EventData class is created and handed over to user's event handler, 80 Bytes. We consider optimizing this by reusing a single class instance

Edit: A way to get rid of the lasting 20 bytes is to cache the reflection call that checks for bound events (e.g. check only once after the controller starts playing). But that would force users to trigger a re-check after they bound an eventhandler. This would be very odd behaviour and against all C# event philosophies, but I'll sleep over this idea.
Reply


Messages In This Thread
100 SC require 10KB GC Alloc - by Trainzland - 01-04-2016, 05:57 PM
RE: 100 SC require 10KB GC Alloc - by Jake - 01-04-2016, 07:33 PM
RE: 100 SC require 10KB GC Alloc - by Trainzland - 01-04-2016, 11:42 PM

Forum Jump: