From 0051da7ce4c5624442580b47d32c055fd6ccece4 Mon Sep 17 00:00:00 2001 From: wenshao Date: Wed, 22 Jan 2025 19:45:33 +0800 Subject: [PATCH] add benchmark --- .../alibaba/fastjson2/benchmark/BytesAsciiCheck.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/benchmark/src/main/java/com/alibaba/fastjson2/benchmark/BytesAsciiCheck.java b/benchmark/src/main/java/com/alibaba/fastjson2/benchmark/BytesAsciiCheck.java index 47dfc547a..5c990aacf 100644 --- a/benchmark/src/main/java/com/alibaba/fastjson2/benchmark/BytesAsciiCheck.java +++ b/benchmark/src/main/java/com/alibaba/fastjson2/benchmark/BytesAsciiCheck.java @@ -80,27 +80,27 @@ public void isLatin1(Blackhole bh) throws Throwable { bh.consume(com.alibaba.fastjson2.util.IOUtils.isLatin1(chars, 0, chars.length)); } -// @Benchmark + @Benchmark public void isASCIIJDK(Blackhole bh) throws Throwable { bh.consume(com.alibaba.fastjson2.util.JDKUtils.PREDICATE_IS_ASCII.test(bytes)); } -// @Benchmark + @Benchmark public void indexOfSlash(Blackhole bh) throws Throwable { bh.consume(com.alibaba.fastjson2.util.IOUtils.indexOfSlash(bytes, 0, bytes.length)); } -// @Benchmark + @Benchmark public void indexOfSlashV(Blackhole bh) throws Throwable { bh.consume(com.alibaba.fastjson2.util.IOUtils.indexOfSlashV(bytes, 0, bytes.length)); } -// @Benchmark + @Benchmark public void indexOfChar(Blackhole bh) throws Throwable { bh.consume(indexOfChar(bytes, '\'', 0, bytes.length)); } -// @Benchmark + @Benchmark public void indexOfString(Blackhole bh) throws Throwable { bh.consume(str.indexOf('\\')); }