shinseongsu opened a new pull request, #913:
URL: https://github.com/apache/httpcomponents-client/pull/913
`BasicHttpClientConnectionManager` still builds its id with
`String.format("ep-%010d", ...)`. #352 replaced the same pattern with
`PrefixedIncrementingId` in `ExecSupport` and in both pooling connection
managers, but this one was left out. This switches it to
`PrefixedIncrementingId("ep-")` as well, so all three connection managers
generate ids the same way. The format stays `ep-` followed by 10 digits.
JMH with `-prof gc` (2 forks, Apple M4 Pro):
| JDK | `String.format` | `PrefixedIncrementingId` |
|---|---|---|
| 11.0.28 | 265.5 ± 21.2 ns/op, 724 B/op | 13.3 ± 0.2 ns/op, 88 B/op |
| 21.0.10 | 234.5 ± 3.1 ns/op, 656 B/op | 12.9 ± 3.4 ns/op, 88 B/op |
The id is created once per manager instance, so this only really shows up
when a client is created per request. It's mostly a consistency fix.
One visible difference: ids now start at `ep-0000000001` instead of
`ep-0000000000`, the same as the pooling managers. The id is only used in log
output. `PrefixedIncrementingId` is backed by an `AtomicLong`, so uniqueness
under concurrent construction is unchanged.
`mvn -pl httpclient5 verify` passes (1113 tests, checkstyle, japicmp).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]