Hi Nathalia,
I am not sure, Andrew Price once mentioned, that unused Nodes were still being calculated, but that was a long time ago and I don’t know how informed he was at the time, or how Blender might have become more efficient.
Personally, I make a habit of not having any unused Nodes in my Node Trees (or ‘crazy’ thing like Divide by 2, followed by a Multiply by 2 (Yes, I’ve seen people do that 🤣)), just to be sure.