Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Java.Interop] optimize JniTypeManager.AssertSimpleReference() (#1001)
We noticed `dotnet trace` output was showing: 21.28ms (0.45%) java.interop!Java.Interop.JniRuntime.JniTypeManager.AssertSimpleReference(string,string) This code path was introduced by a new feature in 1f27ab5. For now, I think we can rewrite this to use the [`string.IndexOf(char)`][0] overload of `string.IndexOf()`, as well as the `string` indexer instead of `string.StartsWith()` and `string.EndsWith()`. After these changes, I get a better time: 1.21ms java.interop!Java.Interop.JniRuntime.JniTypeManager.AssertSimpleReference(string,string) We may have just *moved* the location that ICU is loaded, but this change is good regardless. [0]: https://docs.microsoft.com/en-us/dotnet/api/system.string.indexof?view=net-6.0#system-string-indexof(system-char)
- Loading branch information