I've got hold of the MSIL from ildasm, which I'll post here for someone to elaborate on (no time) - it's community wiki time:
Fast (just the i
comparison lines as the rest are identical):
//000030: if i < 1000 then
IL_001f: ldloc.0
IL_0020: ldc.i4 0x3e8
IL_0025: bge.s IL_003b
//000031: if i < 1000 then
IL_0027: ldloc.0
IL_0028: ldc.i4 0x3e8
IL_002d: bge.s IL_0038
Slow:
//000039: if i < 1000 && i < 1000 then
IL_0084: ldloc.0
IL_0085: ldc.i4 0x3e8
IL_008a: bge.s IL_0097
IL_008c: ldloc.0
IL_008d: ldc.i4 0x3e8
IL_0092: clt
IL_0094: nop
IL_0095: br.s IL_0099
IL_0097: ldc.i4.0
IL_0098: nop
IL_0099: brfalse.s IL_00a4
On a side note, C# version of the same has the same timing for both versions.
One thing I noticed in the disassembly was that the F# variables were Program.i and Program.a, so I'm not sure if there's some object interference in F# that isn't there in C#.