I hate to just say it like this, but it’s unlikely that C# is really your bottleneck. It’s more likely the approach or the libraries you are using that are the issue.
Try a clean implementation of that particular logic in pure C# on .NET Core, you should be able to get it working more than adequately fast. I’m saying this as someone that (re)writes applications in C++ and rust to provide pseudo-rt guarantees.
yeah especially with Span<T> it's way easier to create high performance code, while reducing GC pressure.
Also depending on the Platform P/Invoke to C/C++ is also a solution that works quite better than on Java's JNI.
Try a clean implementation of that particular logic in pure C# on .NET Core, you should be able to get it working more than adequately fast. I’m saying this as someone that (re)writes applications in C++ and rust to provide pseudo-rt guarantees.