Click here to Skip to main content
15,887,214 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
jschell22-Jan-24 5:58
jschell22-Jan-24 5:58 
GeneralRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
honey the codewitch22-Jan-24 6:00
mvahoney the codewitch22-Jan-24 6:00 
GeneralRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
trønderen22-Jan-24 10:10
trønderen22-Jan-24 10:10 
GeneralRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
honey the codewitch22-Jan-24 10:12
mvahoney the codewitch22-Jan-24 10:12 
GeneralRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
trønderen22-Jan-24 10:55
trønderen22-Jan-24 10:55 
GeneralRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
jschell23-Jan-24 5:26
jschell23-Jan-24 5:26 
GeneralRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
honey the codewitch23-Jan-24 5:43
mvahoney the codewitch23-Jan-24 5:43 
GeneralRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
trønderen23-Jan-24 9:06
trønderen23-Jan-24 9:06 
jschell wrote:
The C compiler could be configured to emit assembler. I did that, optimized it, then I used that instead of the original C code in the build.
Did you do much timing to verify the speed gain at the user level? (E.g. from the moment the user supplies some input up to the next request for input from the user. For some applications, you must use other criteria, such as the time from startup to the first screenful has been drawn.)

There are certainly compilers out there that are build by people not very experienced or knowledgeable about compiler optimization. On the other hand, I guess that the true experts keep some tricks up their sleeves. But I'd guess that 98% of all optimizing tricks that have a measurable effect has been documented in publicly available sources. If the compiler writer reads the proper sources and do what they tell him to, there is so little left for "even better" hand optimizing that it certainly isn't worth the effort.

Usually, the compiler knows a lot more than you do about the instruction set, cache, virtual memory etc. It has a lot more background for making the ideal code than you. If you change its proposed code, you will often just be doing it in a different way, but not measurably faster. In the worst case, your 'optimization' may even slow down the code. In the very best case, you may be able to prove a nanosecond or two faster execution - but you need a bag of tricks (not all of them very clean) to 'prove' a speedup at user level.

I have experience with all three of these alternatives. Back in history, you might get a real speedup. First, because on old CPUs the total execution time could be calculated by adding together the cycle counts for every instruction executed. Second, The Book of Well Known Standard Optimizing Tricks was a lot thinner then. The closer we get to the CPUs of today, with a long list of hardware speedup techniques (all sorts of prefetch and lookahead, caches, execution pipelines, speculative execution, ...), the more blurry the 'Add together the timing of all instructions executed' becomes. And The Book is quite thick.

Implement the tricks in the book, and there is not much left to do. But that implementation is the responsibility of the compiler writer.

If you must dig up a really bad compiler written by someone who has never hear of optimization, in order to prove that you can do hand optimizing that has some effect, then you should rather find a better compiler.

Religious freedom is the freedom to say that two plus two make five.

GeneralRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
jschell24-Jan-24 4:38
jschell24-Jan-24 4:38 
GeneralRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
Alister Morton22-Jan-24 22:59
Alister Morton22-Jan-24 22:59 
GeneralRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
honey the codewitch23-Jan-24 3:29
mvahoney the codewitch23-Jan-24 3:29 
JokeRe: Does anyone know of a good guide to the MSIL JIT compiler? Pin
jschell23-Jan-24 5:27
jschell23-Jan-24 5:27 
GeneralRIP David Mills Pin
Mircea Neacsu19-Jan-24 15:54
Mircea Neacsu19-Jan-24 15:54 
GeneralRe: RIP David Mills Pin
jmaida19-Jan-24 17:14
jmaida19-Jan-24 17:14 
GeneralRe: RIP David Mills Pin
Nelek19-Jan-24 21:32
protectorNelek19-Jan-24 21:32 
GeneralRe: RIP David Mills Pin
David O'Neil19-Jan-24 22:18
professionalDavid O'Neil19-Jan-24 22:18 
GeneralRe: RIP David Mills Pin
Nelek20-Jan-24 6:29
protectorNelek20-Jan-24 6:29 
GeneralRe: RIP David Mills Pin
jschell22-Jan-24 6:00
jschell22-Jan-24 6:00 
GeneralRe: RIP David Mills Pin
Nelek22-Jan-24 8:28
protectorNelek22-Jan-24 8:28 
GeneralRe: RIP David Mills Pin
Daniel Pfeffer20-Jan-24 5:02
professionalDaniel Pfeffer20-Jan-24 5:02 
GeneralRe: RIP David Mills Pin
Nelek20-Jan-24 6:26
protectorNelek20-Jan-24 6:26 
GeneralRe: RIP David Mills Pin
obermd20-Jan-24 8:35
obermd20-Jan-24 8:35 
GeneralRe: RIP David Mills Pin
Nelek20-Jan-24 9:59
protectorNelek20-Jan-24 9:59 
GeneralRe: RIP David Mills Pin
PIEBALDconsult24-Jan-24 6:30
mvePIEBALDconsult24-Jan-24 6:30 
GeneralRe: RIP David Mills Pin
Nelek24-Jan-24 9:49
protectorNelek24-Jan-24 9:49 

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.