2008년 3월 24일 월요일

Inlining in Mono JIT

It seems that as of Mono 1.9, the inliner in Mono JIT compiler never inlines functions with any branching opcode. To those in the position to know, I ask:

1. Is this true?
2. If it is true, should I manually inline functions like the following?

public static int Min(int x, int y) {
if (x < y) return x;
else return y;
}

댓글 3개:

vargaz :

Yes, it is true.

Barry Kelly :

You should only inline manually after you've measured and thereby determined that manual inlining is necessary to meet your performance constraints.

Amber :

The conclusive answer to the second question should of course be: *no* you shouldn't do manual inlining.

Instead, let the profiler guide your manual optimizations. If performance is of the essence, switch to a platform with better JIT, pre-compilation (PGO?) or whatever your project needs instead.

Perhaps spend your time improving the JIT instead of doing brainless 'optimization'?