Hi Deiter,

   A couple of comments on this

[EMAIL PROTECTED] wrote on 02/08/2007 03:23:21 AM:

> xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/BridgeContext.

   The main purpose of 'dispose' is to remove references to objects
that otherwise would not have references removed.  In the case of
the Maps the whole map is about to become unreferenced meaning that 
any references it has will become meaningless.  Unless you know
something I don't I suspect that calling 'clear' on these just
adds work and doesn't help anything....

> java Thu Feb  8 00:23:19 2007
> @@ -1450,6 +1450,15 @@
>          if (focusManager != null) {
>              focusManager.dispose();
>          }
> +        if ( elementDataMap != null ){
> +            elementDataMap.clear();
> +        }
> +        if ( nodeElementMap != null ){
> +            nodeElementMap.clear();
> +        }
> +        if ( elementNodeMap != null ){
> +            elementNodeMap.clear();
> +        } 
>      }

   I understand that System.arraycopy is by far
the fastest way to copy large amounts of data, I've
always assumed that for small chunks of data the 
overhead needed for arraycopy to get going (function
call, data type matching, array pinning(?) etc) way 
outweighed the speed advantage once it is going.

   I don't know if there is 'magic' under the
hood that avoids this (for example some C compilers 
will replace calls to memcpy).  So I'm wondering
if you know something I don't or if you are just
operating on the conventional wisdom of use
arraycopy.

> -                coords[0] = (float)values[valsIdx];
> -                coords[1] = (float)values[valsIdx+1];
> -                coords[2] = (float)values[valsIdx+2];
> -                coords[3] = (float)values[valsIdx+3];
> +                // coords[0] = values[valsIdx];
> +                // coords[1] = values[valsIdx+1];
> +                // coords[2] = values[valsIdx+2];
> +                // coords[3] = values[valsIdx+3];
> +                System.arraycopy( values, 0, coords, 0, 4 );
>                  break;

PS.  The space thing.  I don't mind the removal of
trailing whitespace, but can we do this in one large
pass rather one file at a time?  It makes your
commits very hard to read.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to