[OpenJDK Rasterizer] [OpenJDK 2D-Dev] Path2d needRoom very slow for huge paths
Jim Graham
james.graham at oracle.com
Mon Apr 20 20:09:05 UTC 2015
I've started the CCC process by creating a bug.
One quick question - do we want to port these changes back to 8u60? If
so, then we would not be able to port the new Path2D method since there
are no API changes allowed in 8u60. If not, then there is no issue.
Phil?
...jim
On 4/17/15 3:09 AM, Laurent Bourgès wrote:
> Phil & Jim,
>
> Do you have any feedback (CCC) on this Path2D patch ?
>
> http://cr.openjdk.java.net/~lbourges/path2D/Path2D_needRoom.1/
> <http://cr.openjdk.java.net/%7Elbourges/path2D/Path2D_needRoom.1/>
>
> Laurent
>
>
> Le 10 avr. 2015 20:51, "Jim Graham" <james.graham at oracle.com
> <mailto:james.graham at oracle.com>> a écrit :
>
> Hi Laurent,
>
> Adding a new method is not as simple as just sending a webrev.
> We'll need to do some other internal processes to get approval for
> that...
>
> ...jim
>
> On 4/10/15 8:07 AM, Laurent Bourgès wrote:
>
> Jim,
>
> Here is the new webrev:
> http://cr.openjdk.java.net/~lbourges/path2D/Path2D_needRoom.1/
>
> Changes:
> - needRoom() applies your pseudo-code; see expandPointTypes() and
> expandCoords()
> - added a new public trimToSize() method to Path2D implemented
> by both
> Path2D.Float and Path2D.Double classes
>
> Cheers,
> Laurent
>
> 2015-04-08 22:53 GMT+02:00 Jim Graham <james.graham at oracle.com
> <mailto:james.graham at oracle.com>
> <mailto:james.graham at oracle.com <mailto:james.graham at oracle.com>>>:
>
> Hi Laurent,
>
> I'd probably do:
>
> int newsizemin = oldcount + newitems;
> if (newsizemin < oldcount) {
> // hard overflow failure - we can't even accommodate
> // new items without overflowing
> return failure, throw exception?
> }
> int newsize = <growth algorithm computation>;
> if (newsize < newsizemin) {
> // overflow in growth algorithm computation
> newsize = newsizemin;
> ... OR ...
> newsize = MAX_INT;
> }
> while (true) {
> try {
> allocate newsize;
> break; (or return?)
> } catch (OOME e) {
> if (newsize == newsizemin) {
> throw e;
> }
> }
> newsize = newsizemin + (newsize - newsizemin) / 2;
> }
>
>
>
>
> --
> --
> Laurent Bourgès
More information about the graphics-rasterizer-dev
mailing list