Why is the editor recompiling the code when I fire the debugger?

I don’t recall this being the case with older version of Unity, don’t know when this was introduced but it is pretty annoying.
When I need to debug every time I change something I get the usual code recompilation and then another compile when I start the debugger.
Why is doing so?

Don’t start the debugger (eg, the |> arrow button).

Instead, just attach to the Unity process, AFTER Unity rebuilds your game.

I am using F5 shortcut which is the same as pressing “Attach to Unity”. Are you referring to “Attach unity debugger” menu? If that’s the case, I save the compilation time but spend more time on the menu itself, as it open the list of editors and I need to attach, more steps, don’t think I gain much in my case with the compilation being a matter of 10 seconds, maybe with more complex codes?
Anyway I closed both Visual Studio and Unity and now it’s not doing it anymore, I think it’s a bug.