RFR: JDK-8293776 : Adds CSS 4 and 8 digits hex coded Color [v11]
ScientificWare
duke at openjdk.org
Wed Dec 14 18:33:43 UTC 2022
> This is referenced in Java Bug Database as
> - [JDK-8293776 : Adds CSS 4 and 8 digits hex coded Color](https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8293776)
>
> This is tracked in JBS as
> - [JDK-8293776 : Adds CSS 4 and 8 digits hex coded Color](https://bugs.openjdk.java.net/browse/JDK-8293776)
>
> Adds the 4 and 8 digits color hex notations to CSS.java, as described in :
> CSS Color Module Level 4
> W3C Candidate Recommendation Snapshot, 5 July 2022
> [6.2 The RGB Hexadecimal Notations: `#RRGGBB`](https://www.w3.org/TR/css-color-4/#hex-notation)
>
> Designed from : [ScientificWare JDK-8293776 : Adds CSS 4 and 8 digits hex coded Color](https://github.com/scientificware/jdk/issues/13)
ScientificWare has updated the pull request incrementally with one additional commit since the last revision:
Performance improvement
Performance results came from my repository I mentioned in the header.
The code before this PR ran in 230ms.
Our previous codes ran in 1 200ms to 1800 ms with String + formatted + %n$s usage.
They ran in 350ms to 380ms with String + formatted + %s usage.
And in 100ms to 110ms if we replace String + format with a string concatenation.
Now the code below gives the same results in 36ms and with all our expected behaviors. Since we control notation length we
can bypass some controls,
directly generate the color value,
without generate a new string,
and reject a wrong number format without generate any exception.
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/10317/files
- new: https://git.openjdk.org/jdk/pull/10317/files/b73bec53..8f65b852
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=10317&range=10
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=10317&range=09-10
Stats: 67 lines in 1 file changed: 21 ins; 34 del; 12 mod
Patch: https://git.openjdk.org/jdk/pull/10317.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/10317/head:pull/10317
PR: https://git.openjdk.org/jdk/pull/10317
More information about the client-libs-dev
mailing list