[OpenJDK 2D-Dev] [OpenJDK Rasterizer] Path2d needRoom very slow for huge paths
Laurent Bourgès
bourges.laurent at gmail.com
Wed Apr 22 20:22:06 UTC 2015
Jim,
Here is a new webrev to improve the grow algorithm of Path2D needRoom() and
handle properly overflow:
http://cr.openjdk.java.net/~lbourges/path2D/Path2D_needRoom.2/
Changes:
- fixed condition in needRoom() methods to avoid overflow
- use Arrays.copyOf(oldCoords, newSize) in expandCoords() methods instead
of manual allocation + arraycopy
Path2DGrow results:
UNPATCHED:
- Test(Path2D.Double[0]) ---
testAddMoves[1000000] duration= 20.046456 ms.
*testAddLines[1000000] duration= 2744.025722 ms.testAddQuads[1000000]
duration= 10289.854596 ms.testAddCubics[1000000] duration=
23120.553993999998 ms.testAddMoveAndCloses[1000000] duration= 3076.952691
ms.*...
PATCHED:
- Test(Path2D.Double[0]) ---
testAddMoves[1000000] duration= 21.808374 ms.
*testAddLines[1000000] duration= 60.566691 ms.testAddQuads[1000000]
duration= 105.996736 ms.testAddCubics[1000000] duration= 146.004722
ms.testAddMoveAndCloses[1000000] duration= 64.536282 ms.*...
> Le 21 avr. 2015 19:56, "Jim Graham" <james.graham at oracle.com> a écrit :
>
> > Then it might make sense to make a new bug and target the existing patch
> at it by just removing the new method signature...
>
Could you create the new bug and update the bugid in the Path2DGrow test
(@bug TODO) ?
If you (and phil) approve the patch, please push it for me in JDK9 and
request a backport to JDK8.
Laurent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20150422/c4fc4b52/attachment.html>
More information about the 2d-dev
mailing list