I think the new code is more compact and readable which makes it nice. I reviewed it to check that the result is still the same as before.
However, I can’t assess if it is acceptable from a performance point of view and would defer this assessment to some other reviewer. But apart from performance constraints the change seems good.
From: net-dev [mailto:[hidden email]]
On Behalf Of Martin Buchholz Sent: Dienstag, 5. Dezember 2017 05:01 To: net-dev <[hidden email]> Subject: RFR: 8193034: Optimize URL.toExternalForm
that suggests the code is ~ 25% faster with default JVM flags (C2) but ~ 25% slower with C1, as you might expect with multiple String concatenation. I think we want to optimize for the default and assume that multiple String concatenation does in fact get optimized.