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

[2.8.1] perf pass #10643

Merged
merged 25 commits into from
Jun 16, 2022
Merged

[2.8.1] perf pass #10643

merged 25 commits into from
Jun 16, 2022

Conversation

keveleigh
Copy link
Contributor

@keveleigh keveleigh commented Jun 14, 2022

Overview

  • Removes some allocations in CameraFOVChecker, ObjectManipulator, ObjectManipulator, and LRUCache
  • Returns early in MicrosoftArticulatedHand, GenericXRSDKController, and FocusProvider at an earlier point where we know there's no work to be done
  • Cache the result of some expensive (at least, when you call them as much as we do) calls in OpenXRDeviceManager, XRSDKDeviceManager, BaseCursor, and FocusProvider
  • Migrate XRSDKDeviceManager to use the InputDevices events instead of polling every frame (which can be expensive for this method)
  • Update ControllerPoseSynchronizer and FocusProvider to use SetPositionAndRotation in hot loops
  • Update ObjectManipulator to not update twice per frame when doing two handed manipulation...
  • Disable the LinePointer's line data provider when the pointer isn't active, since there's no need to update a line for an inactive pointer
  • Rewrite ObjectManipulator to no longer use a dictionary

@keveleigh
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@keveleigh
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link

@david-c-kline david-c-kline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question about ValueTuple, otherwise looks good!

@@ -37,7 +37,7 @@ public static bool IsInFOVCached(this Camera cam, Collider myCollider)
return false;
}

Tuple<Collider, Camera> cameraColliderPair = new Tuple<Collider, Camera>(myCollider, cam);
ValueTuple<Collider, Camera> cameraColliderPair = ValueTuple.Create(myCollider, cam);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ValueTuple is a .net framework 4.7 feature. any thoughts as to whether or not this will break on older unity versions?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validated a successful UWP IL2CPP build in Unity 2018 locally!
image

@keveleigh
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@keveleigh keveleigh merged commit 6884b43 into microsoft:releases/2.8.1 Jun 16, 2022
@keveleigh keveleigh deleted the 2.8.1-perf branch June 16, 2022 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants