1
vote
1answer
177 views

How does an optimizing compiler react to a program with nested loops?

Say you have a bunch of nested loops. public void testMethod() { for(int i = 0; i<1203; i++){ //some computation for(int k=2; k<123; k++){ ...
0
votes
1answer
229 views

How small is the footprint of a small C compiler?

This week I could optimize using a reduced C library that allowed a drastic shrinkage in code size - from about 60 K to about 6 K and then we could load the code in the 8 K on-chip memory of an FPGA ...
3
votes
1answer
389 views

Does setting a function public affect the C# compiler's ability to inline the function as an optimization?

This could be either for the .NET or Mono compilers. I know that under certain conditions the compiler can inline functions (e.g. small, single call site, etc.) as an optimization. However, if the ...
0
votes
4answers
125 views

Use functions inside a loop declaration

What's the best practice? This : for ($i = 0; $i < count($array); $i++) { //stuff } Or, what I usually do : $count = count($array); for($i = 0; $i < $count; $i++) { //stuff } Is it the ...
0
votes
5answers
321 views

Is comparing an OO compiler to a SQL compiler/optimizer valid?

I'm now doing a lot of SQL development at my new job where as before I was doing Object Oriented desktop app stuff. I keep running across very large scripts (thousands of lines) and wanting to ...
2
votes
3answers
233 views

Is it worth evaluating compiler optimization on trivial cases?

I'm currently testing Visual C++ 10 on some trivial pieces of code. For example, like this one (taken from here): int main() { int i; clrscr(); ...
13
votes
5answers
6k views

JIT compiler for C, C++, and the likes

Is there any just-in-time compiler out there for compiled languages, such as C and C++? (The first names that come to mind are Clang and LLVM! But I don't think they currently support it.) ...
9
votes
2answers
1k views

Compiler optimization examples [closed]

I'd like to see (good) examples of optimizations performed by compilers (static and JIT). Why? To learn what we don't have to optimize ourselves (often leading to better code) To be amazed