Re: RFR: 8315789: Minor HexFormat performance improvements [v2]

2023-09-13 Thread Roger Riggs
On Fri, 8 Sep 2023 10:32:40 GMT, Claes Redestad wrote: >> This PR seeks to improve formatting of hex digits using >> `java.util.HexFormat` somewhat. >> >> This is achieved getting rid of a couple of lookup tables, caching the >> result of `HexFormat.of().withUpperCase()`, and removing tiny all

Re: RFR: 8315789: Minor HexFormat performance improvements [v2]

2023-09-13 Thread Claes Redestad
On Fri, 8 Sep 2023 10:32:40 GMT, Claes Redestad wrote: >> This PR seeks to improve formatting of hex digits using >> `java.util.HexFormat` somewhat. >> >> This is achieved getting rid of a couple of lookup tables, caching the >> result of `HexFormat.of().withUpperCase()`, and removing tiny all

Re: RFR: 8315789: Minor HexFormat performance improvements

2023-09-08 Thread 温绍锦
On Fri, 8 Sep 2023 08:47:04 GMT, Raffaello Giulietti wrote: > I'm not sure that micro-benchmarks are very indicative on whether a lookup > table performs better than short and straightforward code. > The reason is that, once in the CPU caches, a lookup table in > micro-benchmarks stays there,

Re: RFR: 8315789: Minor HexFormat performance improvements

2023-09-08 Thread Claes Redestad
On Wed, 6 Sep 2023 13:36:22 GMT, Claes Redestad wrote: > This PR seeks to improve formatting of hex digits using `java.util.HexFormat` > somewhat. > > This is achieved getting rid of a couple of lookup tables, caching the result > of `HexFormat.of().withUpperCase()`, and removing tiny allocati

Re: RFR: 8315789: Minor HexFormat performance improvements [v2]

2023-09-08 Thread Claes Redestad
> This PR seeks to improve formatting of hex digits using `java.util.HexFormat` > somewhat. > > This is achieved getting rid of a couple of lookup tables, caching the result > of `HexFormat.of().withUpperCase()`, and removing tiny allocation that > happens in the `formatHex(A, byte)` method. Im

Re: RFR: 8315789: Minor HexFormat performance improvements

2023-09-08 Thread Claes Redestad
On Fri, 8 Sep 2023 08:47:04 GMT, Raffaello Giulietti wrote: >> This PR seeks to improve formatting of hex digits using >> `java.util.HexFormat` somewhat. >> >> This is achieved getting rid of a couple of lookup tables, caching the >> result of `HexFormat.of().withUpperCase()`, and removing ti

Re: RFR: 8315789: Minor HexFormat performance improvements

2023-09-08 Thread Raffaello Giulietti
On Wed, 6 Sep 2023 13:36:22 GMT, Claes Redestad wrote: > This PR seeks to improve formatting of hex digits using `java.util.HexFormat` > somewhat. > > This is achieved getting rid of a couple of lookup tables, caching the result > of `HexFormat.of().withUpperCase()`, and removing tiny allocati

Re: RFR: 8315789: Minor HexFormat performance improvements

2023-09-07 Thread 温绍锦
On Wed, 6 Sep 2023 13:36:22 GMT, Claes Redestad wrote: > This PR seeks to improve formatting of hex digits using `java.util.HexFormat` > somewhat. > > This is achieved getting rid of a couple of lookup tables, caching the result > of `HexFormat.of().withUpperCase()`, and removing tiny allocati

Re: RFR: 8315789: Minor HexFormat performance improvements

2023-09-07 Thread Claes Redestad
On Wed, 6 Sep 2023 13:36:22 GMT, Claes Redestad wrote: > This PR seeks to improve formatting of hex digits using `java.util.HexFormat` > somewhat. > > This is achieved getting rid of a couple of lookup tables, caching the result > of `HexFormat.of().withUpperCase()`, and removing tiny allocati

Re: RFR: 8315789: Minor HexFormat performance improvements

2023-09-07 Thread 温绍锦
On Wed, 6 Sep 2023 13:36:22 GMT, Claes Redestad wrote: > This PR seeks to improve formatting of hex digits using `java.util.HexFormat` > somewhat. > > This is achieved getting rid of a couple of lookup tables, caching the result > of `HexFormat.of().withUpperCase()`, and removing tiny allocati

Re: RFR: 8315789: Minor HexFormat performance improvements

2023-09-06 Thread Claes Redestad
On Wed, 6 Sep 2023 16:10:23 GMT, Claes Redestad wrote: >> src/java.base/share/classes/java/util/HexFormat.java line 644: >> >>> 642: return (char)('a' - 10 + value); >>> 643: } >>> 644: return (char)('A' - 10 + value); >> >> Not sure if this would adversely impact pe

Re: RFR: 8315789: Minor HexFormat performance improvements

2023-09-06 Thread Claes Redestad
On Wed, 6 Sep 2023 15:29:45 GMT, Raffaello Giulietti wrote: >> This PR seeks to improve formatting of hex digits using >> `java.util.HexFormat` somewhat. >> >> This is achieved getting rid of a couple of lookup tables, caching the >> result of `HexFormat.of().withUpperCase()`, and removing ti

Re: RFR: 8315789: Minor HexFormat performance improvements

2023-09-06 Thread Claes Redestad
On Wed, 6 Sep 2023 15:34:54 GMT, Roger Riggs wrote: >> This PR seeks to improve formatting of hex digits using >> `java.util.HexFormat` somewhat. >> >> This is achieved getting rid of a couple of lookup tables, caching the >> result of `HexFormat.of().withUpperCase()`, and removing tiny alloca

Re: RFR: 8315789: Minor HexFormat performance improvements

2023-09-06 Thread Roger Riggs
On Wed, 6 Sep 2023 13:36:22 GMT, Claes Redestad wrote: > This PR seeks to improve formatting of hex digits using `java.util.HexFormat` > somewhat. > > This is achieved getting rid of a couple of lookup tables, caching the result > of `HexFormat.of().withUpperCase()`, and removing tiny allocati

Re: RFR: 8315789: Minor HexFormat performance improvements

2023-09-06 Thread Raffaello Giulietti
On Wed, 6 Sep 2023 13:36:22 GMT, Claes Redestad wrote: > This PR seeks to improve formatting of hex digits using `java.util.HexFormat` > somewhat. > > This is achieved getting rid of a couple of lookup tables, caching the result > of `HexFormat.of().withUpperCase()`, and removing tiny allocati

RFR: 8315789: Minor HexFormat performance improvements

2023-09-06 Thread Claes Redestad
This PR seeks to improve formatting of hex digits using `java.util.HexFormat` somewhat. This is achieved getting rid of a couple of lookup tables, caching the result of `HexFormat.of().withUpperCase()`, and removing tiny allocation that happens in the `formatHex(A, byte)` method. Improvements r