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

John Hendrikx jhendrikx at openjdk.org
Sat Feb 14 14:04:10 UTC 2026


On Sat, 14 Feb 2026 12:11:36 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:

>> Color.web(string, double) parses a color string by creating substrings of the input. These string allocations can be removed.
>> 
>> There are no new tests for the `Color` class, since the existing tests already cover all relevant code paths.
>
> Michael Strauß has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - review comment
>  - review comment

Still looks good :)

modules/javafx.graphics/src/main/java/com/sun/javafx/css/parser/CssNumberParser.java line 305:

> 303:      * @see <a href="https://arxiv.org/pdf/2101.11408">Number Parsing at a Gigabyte per Second</a>
> 304:      */
> 305:     public static final long[] T;

Perhaps add a comment here about how big this array will be (about 10 kB)

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

Marked as reviewed by jhendrikx (Reviewer).

PR Review: https://git.openjdk.org/jfx/pull/2069#pullrequestreview-3801890181
PR Review Comment: https://git.openjdk.org/jfx/pull/2069#discussion_r2807515979


More information about the openjfx-dev mailing list