[Mono-dev] mono numerical performance
Dawid Weiss
dawid.weiss at gmail.com
Sun Nov 20 13:39:56 EST 2011
As far as I know the final on local variables is only a hint for the java
compiler (javac), not jit (hotspot) engine. Detection of loop invariants is
done at runtime (during code jitting) so there's really no difference
between any of the following in modern Java jits:
1) (final) int max = array.length;
for (int i = 0; i < max; i++) {}
2) for (int i = 0; i < array.length; i++) {}
Dawid
2011/11/20 Konrad M. <konrad.kruczynski at gmail.com>
> On the other hand, maybe it could be possible to add the final-like
> mechanism to Mono's compiler. Such mechanism would be beneficial if the
> CLR had some notion of local readonly variables. F# uses non-mutable
> variables a lot, so maybe CLR recognizes it. I am not sure what kind of
> transparent denotation could be used - maybe some kind of comment, like
> it was done in MS Java in the pre-annotations days.
>
> Does Mono team see this as something worth considering? Probably proper
> analysis of assignments is a better idea.
>
> --
> Regards,
> Konrad
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20111120/4a42ba04/attachment.html
More information about the Mono-devel-list
mailing list