[Mono-devel-list] StringBuilder patch
Piers Haken
piersh at friskit.com
Mon Jan 12 15:15:39 EST 2004
> > + if (_length < (_str.Length / 2))
>
> Use a shift directly here, instead of the division, so we
> don't have to bother optimizing it.
'GCC -O3' doesn't do this? You gotta be kidding me! (the JIT <i>can</i>
shift this, right?)
BTW: speaking of JIT optimizations, here's a few questions:
- who's up for guessing the best x86 asm for this:
int foo (int i) { return (i == 0) ? 3 : 7; }
<hint> no branches </hint>
- how common is this construct?
- how easy would it be to implement support for this kind of optimization in
the current JIT framework.
P.,
More information about the Mono-devel-list
mailing list