RFR: 8377427: Reduce substring allocations in Color.web(String, double) [v7]
Michael Strauß
mstrauss at openjdk.org
Tue Feb 17 20:39:11 UTC 2026
On Tue, 17 Feb 2026 20:06:22 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
>> A stylesheet is not reparsed, but inline styles are when changed. Applications might also swap out stylesheets at runtime. `Color.web()` also seems to be used in `ColorConverter`.
>
> 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`).
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/2069#discussion_r2818969377
More information about the openjfx-dev
mailing list