Thanks for your reply. I at least logged the time before and after inside the c++ code assuming it’s a blocking code. I now converted the code back to python and it works very fast compared to the c++ setup, I don’t know why.