Function definition inside let-block impacting performance?

I think this could be a variation of the problem in this recent thread

But I am too tired to see how the connection is exactly.