Hi,

I think what you are doing is an optimization at the cost of clarity and
also not an optimization in some dimensions.

Copying and pasting code results in more code which prevents the JVM from
inlining as aggressively. If this is to save two comparison it doesn't make
much sense to me.

You could always benchmark with JMH and see how much it actually buys you.

I think that pushing stuff into methods is fine, but duplicating is not.

I think this makes it harder to introduce new code. If I wanted to
implement checks to spin if there was a steady stream of work it would be
trickier and I would have to do it multiple times.

Thanks,
Ariel




On Mon, Mar 31, 2014 at 6:10 PM, wweiss-voltdb <notifications@github.com>wrote:

> In src/frontend/org/voltcore/network/VoltNetwork.java:
>
> >          try {
> >              while (m_shouldStop == false) {
> >                  try {
> > -                    while (m_shouldStop == false) {
>
> Hi Ariel, I have changed to code to minimize the loops. The only way to
> reduce code further is with method parameters and I don't know how or if
> they get optimized so if you think it is still to complex, I will just put
> it back the old way and and a conditional in the main loop. Thanks,
> ... <#1451a31c64094e8b_>
> -Walter
> On Fri, Mar 28, 2014 at 5:46 PM, aweisberg <notifications@github.com>
> wrote: In src/frontend/org/voltcore/network/VoltNetwork.java: > try { >
> while (m_shouldStop == false) { > try { > - while (m_shouldStop == false) {
> Duplicating the loop is way too much copy pasta to remove one if statement.
> Pulling the estimate time stuff into a separate function makes sense
> though. I would push the condition for different key set types into an
> invokeCallbacks wrapper. -- Reply to this email directly or view it on
> GitHub<https://github.com/VoltDB/voltdb/pull/1252/files#r11087128> .
>  -- *Walter Weiss,* Software Engineer *VoltDB, Inc.* *E:*
> wweiss@voltdb.com *O:* +1 978.528.0592 *M:* +1 978.204.4745 www.voltdb.com<
> http://voltdb.com> Follow VoltDB on Twitter <https://twitter.com/voltdb>,
> Facebook<https://www.facebook.com/VoltDB?sk=wall>, and LinkedIn <
> http://www.linkedin.com/company/voltdb>
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/VoltDB/voltdb/pull/1252/files#r11139667>
> .
>