I see laserlight knows what I'm talking about . I wanna calculate theta(n) using the formulas in the book , but I wanna calculate the constants too
That's what bothers me . Putting Knuth's formulas into practice .
I admit it's a crazy obsession , but that's me :)
Thanks guys .You convinced me . It would probably be extremely complicated and totally useless to calculate those constants .
So if I'll stick to only timing the algorithms , what compiler/IDE would you recommend me so porting from bc 3.1 be easy ?
Well dev-c++ seems to be a popular choice for compiler (the MinGW port of gcc) and an IDE.
Though a fair few people prefer to use the separate code::blocks IDE with it.
Dev-C++ is a good IDE that comes with a good compiler, as already stated.
Microsoft has also recently released Visual Studio Express as a free download off their site.
By the way, TechHigh, you were talking about your obsession to see what is happening on every single clock cycle of execution.
Although it is almost impossible to do so at such a high level, especially with varying implementations of algorithms, you might think about learning the circuit-design languages VHDL or Verilog. Actually, you wouldn't want to spend time implementing a sorting algorithm in either of these languages...because it would be quite complex...but if your obsession about seeing every clock cycle is a general one, in other words, you are always wondering what is happening deep under the hood no matter what program, code, or algorithm is being executed...then these languages would be for you. VHDL and Verilog are more for Computer and Electrical Engineers than for a Computer Scientist...so it is more in the engineering field.
This is just a tip...you can take it or leave it...depends HOW MUCH interest you have in that kind of stuff.
VHDL and Verilog are languages that allow you to actually design low level circuits...circuits that get implemented on circuit board: processors, chips, etc.
Seeing what happens on every clock cycle is very common-place in these languages. You very often times will run a simulation of your circuit on the computer, and watch as a "wave form" is outputted to you...so you can see the state of each wire, flip-flop, or signal...whether it is a 1 or a 0.
It is pretty cool stuff.
Intel does not include timing information with the present instruction set. I can only gather this means that instruction timing and cycle counts are non-constant and rely on other parameters such as machine state prior to execution, cache state, instruction cache state, etc, etc.
Modern processors do not fetch, decode, execute like older ones. The newer processors fetch as little as possible and also use branch prediction to speed up the process. The only thing faster than an IF is not testing it at all which is what branch prediction attempts to do.
It is not possible to time each instruction on a newer AMD or Intel x86 CPU and it has nothing to do with Windows or the operating system. You can, however, obtain an average cycle count across many samples and many executions to get an idea of the time involved for instructions.
But with modern clock speeds I doubt you will find much difference between instructions and even if you do, you will see the difference is minute. You used to be able to say if a mov ax,bx took 3 cycles then it makes sense that a register to register mov takes at least 3 cycles. Multiply that by how many register to register movs you make and you get your cycle count. You cannot do this on today's processor b/c the process is not as straightforward as it once used to be.