I just wanted to highlight an issue I noticed recently in InputDeviceManager. I noticed I was getting frequent spiky frames due to GC, and one cause of garbage came from this component, from the DefaultGetKeyDown method. It generates garbage every frame as a result of using string.ToLower. I wonder if case-invariant checking is really necessary there? And if it is, I think it would be better to use something like:
Code: Select all
s.StartsWith("mouse", StringComparison.InvariantCultureIgnoreCase))
Code: Select all
string.Compare(s, "mouse0", true) == 0
Andy