RFR: 8377427: Reduce substring allocations in Color.web(String, double) [v7]

Andy Goryachev angorya at openjdk.org
Tue Feb 17 20:43:50 UTC 2026


On Tue, 17 Feb 2026 20:36:59 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:

>> good point.  still, this feels like an overkill (especially in the absence of any real world measurement).
>> 
>> what if we use a non-allocating parsing for integer values, and as soon as we encounter a fraction or an exponent, we use the good old `Double.parseDouble()`?  just a thought.
>
> I mean, we can do lots of things, including that. However, with this change, we have a CSS-compliant number parser (which is what JavaFX claims to have, but doesn't), which we can reuse at a later time (I'm looking at `CssParser`).

OK, I am not against doing this in principle.  But it's a new, non-trivial algorithm that needs to have additional tests and the implementation needs to be reviewed.  The PR description should also change to reflect this added complexity.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2069#discussion_r2818984386


More information about the openjfx-dev mailing list