The final code takes just 2.90ms per iteration.
You can always speed up an application if you rewrite the used libraries to match your specific use case.
So much faster that the allocations for the result will probably be the bottleneck.
"That Rust library will be faster than the corresponding python library" is a useful thing to know here.