On Thu, 1 Aug 2024 19:06:57 GMT, Daniel Gredler <d...@openjdk.org> wrote:
> At some point the `JPEGImageWriter` was optimized to reduce duplication / > copying of rasters and data buffers (see `JDK-6266748`). However, > `PNGImageWriter` never received a similar optimization, and is making > unnecessary copies of raster and data buffers whenever PNG images are written. > > Measurements: In a local test, `PNGImageWriter.write( )` and callees were > initially showing up as an allocation hotspot (~400k objects / ~65 MB > allocated), but after these optimizations I'm seeing much better numbers > (~400 objects / ~740 KB allocated). This pull request has now been integrated. Changeset: 89a15f14 Author: Daniel Gredler <daniel.gred...@gmail.com> Committer: Laurent Bourgès <lbour...@openjdk.org> URL: https://git.openjdk.org/jdk/commit/89a15f1414f89d2dd32eac791e9155fcb4207e56 Stats: 200 lines in 2 files changed: 195 ins; 1 del; 4 mod 8337681: PNGImageWriter uses much more memory than necessary Reviewed-by: prr, lbourges ------------- PR: https://git.openjdk.org/jdk/pull/20432