Click here to Skip to main content
15,885,546 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Java vs. C++ Pin
LCI18-Sep-07 4:09
LCI18-Sep-07 4:09 
GeneralRe: Java vs. C++ Pin
David Crow18-Sep-07 4:23
David Crow18-Sep-07 4:23 
GeneralRe: Java vs. C++ Pin
bob1697218-Sep-07 6:50
bob1697218-Sep-07 6:50 
AnswerRe: Java vs. C++ Pin
Russell'18-Sep-07 4:14
Russell'18-Sep-07 4:14 
GeneralRe: Java vs. C++ Pin
Mike Dimmick18-Sep-07 4:20
Mike Dimmick18-Sep-07 4:20 
GeneralRe: Java vs. C++ Pin
Russell'18-Sep-07 4:31
Russell'18-Sep-07 4:31 
GeneralRe: Java vs. C++ Pin
LCI18-Sep-07 8:47
LCI18-Sep-07 8:47 
GeneralRe: Java vs. C++ Pin
Mike Dimmick18-Sep-07 9:55
Mike Dimmick18-Sep-07 9:55 
I don't think the Java-to-bytecode compiler has different options here. I'm more familiar with C#, where the C#-to-IL compiler csc does have a /debug option. This has the effect of inserting a certain number of nop IL instructions to ensure that line number information lines up and that you can put a breakpoint on some lines that otherwise wouldn't be possible (for example on the closing brace of a block). Further, it emits a DebuggableAttribute which the JIT compiler detects - this disables JIT optimizations to make the code easier to debug. I don't know if Java JIT compilers have similar options.

Compiling a similar C# program with C# 2.0 gives 10.8s on my home computer with /debug:full and 1.078 second with /debug:pdbonly. With /debug- it's 1.062s. I should say here that my home computer ran the unoptimized C++ version in 14.4s - it's a Core 2 Duo T7200-based laptop (2.0GHz) whereas my work computer is a P4 3.0GHz with HyperThreading enabled. It looks, from sticking a call to System.Diagnostics.Debugger.Break at the top of Main and looking at the disassembly in VS, like it's managed to eliminate the contents of the loop but not the loop itself; however, it's keeping and manipulating the loop counter variable in a register.

Stability. What an interesting concept. -- Chris Maunder

GeneralRe: Java vs. C++ Pin
jhwurmbach18-Sep-07 4:53
jhwurmbach18-Sep-07 4:53 
GeneralRe: Java vs. C++ Pin
Russell'18-Sep-07 5:11
Russell'18-Sep-07 5:11 
GeneralRe: Java vs. C++ Pin
jhwurmbach18-Sep-07 5:25
jhwurmbach18-Sep-07 5:25 
GeneralRe: Java vs. C++ Pin
Russell'18-Sep-07 5:44
Russell'18-Sep-07 5:44 
GeneralRe: Java vs. C++ Pin
El Corazon18-Sep-07 8:22
El Corazon18-Sep-07 8:22 
GeneralRe: Java vs. C++ Pin
jhwurmbach18-Sep-07 8:31
jhwurmbach18-Sep-07 8:31 
GeneralRe: Java vs. C++ Pin
El Corazon18-Sep-07 9:01
El Corazon18-Sep-07 9:01 
AnswerRe: Java vs. C++ Pin
Mike Dimmick18-Sep-07 4:19
Mike Dimmick18-Sep-07 4:19 
AnswerRe: Java vs. C++ Pin
Nemanja Trifunovic18-Sep-07 4:46
Nemanja Trifunovic18-Sep-07 4:46 
AnswerRe: Java vs. C++ Pin
El Corazon18-Sep-07 5:00
El Corazon18-Sep-07 5:00 
AnswerRe: Java vs. C++ Pin
bob1697218-Sep-07 6:39
bob1697218-Sep-07 6:39 
GeneralRe: Java vs. C++ Pin
jhwurmbach18-Sep-07 8:33
jhwurmbach18-Sep-07 8:33 
QuestionComplier C2664 Error Pin
Andy20218-Sep-07 3:02
Andy20218-Sep-07 3:02 
QuestionRe: Complier C2664 Error Pin
David Crow18-Sep-07 3:06
David Crow18-Sep-07 3:06 
AnswerRe: Complier C2664 Error Pin
Andy20218-Sep-07 4:11
Andy20218-Sep-07 4:11 
GeneralRe: Complier C2664 Error Pin
David Crow18-Sep-07 4:19
David Crow18-Sep-07 4:19 
GeneralRe: Complier C2664 Error Pin
Andy20218-Sep-07 4:29
Andy20218-Sep-07 4:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.