I believe I have written this not in the best way. (I have uploaded a slightly improved version)
I did not really notice a large performance impact.
Unless you are in an environment where compute performance is critical, I think this is something interesting to try.