Using Xamarin Profiler I found millions of the Keys class being instantiated in DefaultInputProvider.Update when you iterate over System.Enum.GetValues(typeof(Keys)). Several Megabytes in a few seconds and growing.
(this was taken after about 10 seconds)
Adding private class variable Keys[] _allKeys = (Keys[])System.Enum.GetValues(typeof(Keys)); and iterating over that reduces memory usage to a few kB and remains perfectly steady.
(this was taken after about 2 minutes with this change)
I have a local branch with this change and would be happy to make a PR with contributor permission.
Using Xamarin Profiler I found millions of the Keys class being instantiated in DefaultInputProvider.Update when you iterate over
System.Enum.GetValues(typeof(Keys))
. Several Megabytes in a few seconds and growing.(this was taken after about 10 seconds)
Adding private class variable
Keys[] _allKeys = (Keys[])System.Enum.GetValues(typeof(Keys));
and iterating over that reduces memory usage to a few kB and remains perfectly steady.(this was taken after about 2 minutes with this change)
I have a local branch with this change and would be happy to make a PR with contributor permission.