gerryg400 wrote:You may be correct, but I think you're simply guessing. What about some evidence ?
What optimisations can you make to code that gcc has optimised for speed that will futher speed it up ?
I'm amazed that you even need to ask. Have you never used assembler? If you really know what you're talking about, you should be able to provide examples of your own.
gerryg400 wrote:You have a monitor program. It sounds a bit old-fashioned in design but that's okay.
It's simple, but I keep adding capability to it. There's actually quite a lot left to add because so far I've done all my work on old machines which lack many of the newer instructions.
All these things can be done by compilers, so clearly your system will absolutely be required to do them if you want to produce average code.
That's the whole point - to eliminate any code-optimisation advantage that a compiler might have so that none of my code runs slower.
Only matching the output of state of the art compilers is an epic fail. You are playing catch-up and not catching up.
I will catch up and then stay level on that score - the whole point is to automate as much as possible such that even keeping up with new developments is made easy. There is no epic fail and indeed no fail about it - parts of my code will run faster than compiled code, while none will run slower.
Here's a question for you though: which compiler should I be comparing my code against? Do the more expensive ones produce the fastest code or does the free Microsoft Visual C++ 2010 Edition (which I recently acquired) do just as well?
I'm surprised to see this question. You've been talking like you've already tested your ideas (at least theoretically) against the best of the current compilers. It now sounds like perhaps you haven't.
I've made no secret of the fact that I've only just started learning to program in C++ and that I've no experience in programming in assembler or any other serious programming language, the only ones I've used being Basic (which I used in the early days to poke my original machine code program into memory) and JavaScript (which I use on Web pages, often in unorthodox ways - see
http://www.magicschoolbook.com/maths/graph and
http://www.magicschoolbook.com/writing/small which teaches young children the right way to write the letters of the alphabet).
I don't need to compare my code with compiled output to know that many parts of my code will run faster: I can do things which the compiler simply cannot have the intelligence to do unless it's running human-level A.I. Of course, it may be that C allows you to do all the same low level stuff whenever you have to, though I have heard that you can't even access the carry flag. I use it all the time to simplify and speed up code.