mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8316681: Rewrite URLEncoder.encode to use small reusable buffers
Reviewed-by: dfuchs, rriggs
This commit is contained in:
parent
bd2439f3fc
commit
c24c66db97
4 changed files with 82 additions and 19 deletions
|
@ -190,4 +190,18 @@ public class URLEncodeDecode {
|
|||
}
|
||||
|
||||
|
||||
@Benchmark
|
||||
public void testEncodeLatin1(Blackhole bh) throws UnsupportedEncodingException {
|
||||
for (String s : testStringsEncode) {
|
||||
bh.consume(java.net.URLEncoder.encode(s, StandardCharsets.ISO_8859_1));
|
||||
}
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public void testDecodeLatin1(Blackhole bh) throws UnsupportedEncodingException {
|
||||
for (String s : testStringsDecode) {
|
||||
bh.consume(URLDecoder.decode(s, StandardCharsets.ISO_8859_1));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue