In C, you can wrap the 'commented' code with #if 0 ... #endif
#if 1
....new code...
#else
....old code...
#endif
Esp. for tricky stuff, it's then possible to just flip the 1/0 to easily test/compare/profile the new/old code.Some IDE's will even work out which block of code to colour and which to dim.
You can just use a life if-else, most compilers will optimize the test-on-a-constant away. Even when the code is kept in, I doubt it will have a major performance impact during testing in most cases.
#if !defined(this_works_but_it_suck_memory_too_hard)
....
#else
....
#endif
That should give me a clue why I "disabled" it when I come back to it 5 minutes later. //*
old_code();
/*/
new_code();
//*/
And remove the first slash from the first line to switch between blocks.