can you write a vbench for the code below this? there are quite a lot of API calls here. Some of these functions are exposed in numpy's C API, which might be worth investigating down the line for potential speed ups.