The best way to find out is to look at the code! Here's the VS2005 C # code created in release mode:
static bool F1 (int condition) { if (condition > 100) 00000000 push ebp 00000001 mov ebp,esp 00000003 push eax 00000004 mov dword ptr [ebp-4],ecx 00000007 cmp dword ptr ds:[009185C8h],0 0000000e je 00000015 00000010 call 79469149 00000015 cmp dword ptr [ebp-4],64h 00000019 jle 00000024 { return true; 0000001b mov eax,1 00000020 mov esp,ebp 00000022 pop ebp 00000023 ret } return false; 00000024 xor eax,eax 00000026 mov esp,ebp 00000028 pop ebp 00000029 ret } static bool F2 (int condition) { if (condition > 100) 00000000 push ebp 00000001 mov ebp,esp 00000003 push eax 00000004 mov dword ptr [ebp-4],ecx 00000007 cmp dword ptr ds:[009185C8h],0 0000000e je 00000015 00000010 call 79469109 00000015 cmp dword ptr [ebp-4],64h 00000019 jle 00000024 { return true; 0000001b mov eax,1 00000020 mov esp,ebp 00000022 pop ebp 00000023 ret } else { return false; 00000024 xor eax,eax 00000026 mov esp,ebp 00000028 pop ebp 00000029 ret }
Which shows that the two versions produce the exact same code you would hope for. I also tried the third option:
static bool F3 (int condition) { return condition > 100; 00000000 push ebp 00000001 mov ebp,esp 00000003 push eax 00000004 mov dword ptr [ebp-4],ecx 00000007 cmp dword ptr ds:[009185C8h],0 0000000e je 00000015 00000010 call 794690C9 00000015 cmp dword ptr [ebp-4],64h 00000019 setg al 0000001c movzx eax,al 0000001f mov esp,ebp 00000021 pop ebp 00000022 ret }
which is much more efficient since it never branches (and branches are usually bad!).
EDIT
In fact, the best way to find out which is more efficient is to profile the code, rather than looking at the assembler.
In addition, the code he generated is rather unusual. The current eax / mov [], ecx is the same, of course, as one push ecx. In addition, it passes the register and then stores the value on the stack. I wonder if the code works in the debugger to look at the assembler by changing the way the code is generated.