beamable / BeamableProduct

The beamable product suite including com.beamable, com.beamable.server, microservice base image, portal, the installer, and build scripts
Other
3 stars 0 forks source link

fixes 3445 - BeamablePackages delayCall #3446

Closed cdhanna closed 1 month ago

cdhanna commented 1 month ago

I swear at one point, there were Unity docs advising us to ping against their Package API using delayCall. The docs currently advise to use EditorApplication.update instead, which I've done in this PR.

Looking at profiler reports, it becomes clear that the delayCall approach is especially nasty, because part of the execution logic is to append a delegate to the delayCall action. And apparently, that gets more and more expensive the more often you do it. Perhaps because in order to combine the delegates, it needs to re-capture variables or something.

But this approach in the PR attaches the delegate once, and then is responsible for clearing the delegate when the operation completes.

cdhanna commented 1 month ago

I did run a profiler, and saw less GC.