On Tue, 7 Nov 2023 11:09:08 GMT, Martin Desruisseaux <[email protected]> wrote:

>would be replaced by the following (this code contains a call to getBounds() 
>overrideable method):

That call could be eliminated if you create the new rect using "minX, minY, 
width, height". But the new code adds allocation of two new objects which 
immediately become garbage, probably we can change the code w/o using Rectangle?

> But anyway, the cost of Rectangle allocation is probably small comparatively 
> to the cost of copying some thousands of pixel values.

But can we solve both issues, add optimization w/o creating the new objects?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/13797#issuecomment-1800203841
PR Comment: https://git.openjdk.org/jdk/pull/13797#issuecomment-1804319579

Reply via email to