commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: [MATH] Interest in large patches for small cleanup / performance changes?
Date Mon, 04 Nov 2013 16:55:13 GMT
On 2 November 2013 14:52, Sean Owen <srowen@apache.org> wrote:
> In Math, is there any appetite for large patches containing many
> instances of particular micro-optimizations? Examples:
>
> - Replace:
>     a[i][j] = a[i][j] + foo;
>   with:
>     a[i][j] += foo;
>   … which is faster/leaner in the byte code by a little bit. It might
> make a difference in many nested, tight loops.

Regardless of any speedup, it's safer not to repeat the value.

a[i][j] = a[i][j] + foo;
looks a lot like
a[i][j] = a[i][i] + foo;
or
a[i][j] = a[j][i] + foo;
at first glance, whereas
a[i][j] += foo;
is unambiguous, and much clearer.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message