Skip to content

Commit

Permalink
chore(java): Replace io.* in the benchmark with org.apache.fury (apac…
Browse files Browse the repository at this point in the history
…he#1453)

Signed-off-by: LiangliangSui <[email protected]>
  • Loading branch information
LiangliangSui authored Apr 2, 2024
1 parent 6260794 commit 700181a
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 14 deletions.
4 changes: 2 additions & 2 deletions java/benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ cd ../java && mvn install -DskipTests -Dcheckstyle.skip -Dlicense.skip -Dmaven.j
mvn package -Pjmh
# run benchmark
nohup java -jar target/benchmarks.jar -f 5 -wi 3 -i 5 -t 1 -w 3s -r 5s -rf csv >bench.log 2>&1 &
java -jar target/benchmarks.jar "io.*\.deserialize$" -f 1 -wi 1 -i 3 -t 1 -w 2s -r 2s -rf csv
java -jar target/benchmarks.jar "org.apache.fury.*\.deserialize$" -f 1 -wi 1 -i 3 -t 1 -w 2s -r 2s -rf csv
```

Generate Protobuf/Flatbuffers code manually:
Expand Down Expand Up @@ -75,7 +75,7 @@ Using `async-profiler` to generate flame graph.

```bash
export pic=s1.html
nohup java -jar target/benchmarks.jar 'io.*Fury.*deserialize*' -f 1 -wi 1 -i 1 -t 1 -w 1s -r 35s -rf csv &
nohup java -jar target/benchmarks.jar 'org.apache.fury.*Fury.*deserialize*' -f 1 -wi 1 -i 1 -t 1 -w 1s -r 35s -rf csv &
profiler.sh -d 30 -f $pic `jps | grep ForkedMain | awk '{print $1}'`
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public Object serializeList() {
// ops/s
public static void main(String[] args) throws Exception {
if (args.length == 0) {
String commandLine = "io.*ArraySuite.* -f 1 -wi 3 -i 3 -t 1 -w 2s -r 2s -rf csv";
String commandLine = "org.apache.fury.*ArraySuite.* -f 1 -wi 3 -i 3 -t 1 -w 2s -r 2s -rf csv";
System.out.println(commandLine);
args = commandLine.split(" ");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public class Benchmark {
// the compile process.
public static void main(String[] args) throws Exception {
if (args.length == 0) {
String commandLine = "io.*_deserialize$ -f 3 -wi 5 -i 3 -t 1 -w 3s -r 3s -rf csv";
String commandLine =
"org.apache.fury.*_deserialize$ -f 3 -wi 5 -i 3 -t 1 -w 3s -r 3s -rf csv";
System.out.println(commandLine);
args = commandLine.split(" ");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public class CollectionSuite {

public static void main(String[] args) throws Exception {
if (args.length == 0) {
String commandLine = "io.*CollectionSuite.* -f 3 -wi 5 -i 5 -t 1 -w 2s -r 2s -rf csv";
String commandLine =
"org.apache.fury.*CollectionSuite.* -f 3 -wi 5 -i 5 -t 1 -w 2s -r 2s -rf csv";
System.out.println(commandLine);
args = commandLine.split(" ");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public static void main(String[] args) throws Exception {
System.out.printf("latinStrChars length %s\n", latinStrChars.length);
if (args.length == 0) {
String commandLine =
"io.*CompressStringSuite.latin* -f 1 -wi 3 -i 3 -t 1 -w 2s -r 2s -rf csv";
"org.apache.fury.*CompressStringSuite.latin* -f 1 -wi 3 -i 3 -t 1 -w 2s -r 2s -rf csv";
System.out.println(commandLine);
args = commandLine.split(" ");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
public class MapSuite {
public static void main(String[] args) throws IOException {
if (args.length == 0) {
String commandLine = "io.*MapSuite.* -f 1 -wi 3 -i 3 -t 1 -w 2s -r 2s -rf csv";
String commandLine = "org.apache.fury.*MapSuite.* -f 1 -wi 3 -i 3 -t 1 -w 2s -r 2s -rf csv";
System.out.println(commandLine);
args = commandLine.split(" ");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ public Object bufferUnsafeReadInt(MemoryState state) {

public static void main(String[] args) throws Exception {
if (args.length == 0) {
String commandLine = "io.*MemorySuite.* -f 1 -wi 3 -i 3 -t 1 -w 2s -r 2s -rf csv";
String commandLine =
"org.apache.fury.*MemorySuite.* -f 1 -wi 3 -i 3 -t 1 -w 2s -r 2s -rf csv";
System.out.println(commandLine);
args = commandLine.split(" ");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ public Object createJDK8StringByFury() {
public static void main(String[] args) throws Exception {
Preconditions.checkArgument(new NewJava11StringSuite().createJDK11StringByUnsafe().equals(str));
if (args.length == 0) {
String commandLine = "io.*NewJava11StringSuite.* -f 3 -wi 5 -i 3 -t 1 -w 2s -r 2s -rf csv";
String commandLine =
"org.apache.fury.*NewJava11StringSuite.* -f 3 -wi 5 -i 3 -t 1 -w 2s -r 2s -rf csv";
System.out.println(commandLine);
args = commandLine.split(" ");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ static void putChar(byte[] val, int index, int c) {

public static void main(String[] args) throws Exception {
if (args.length == 0) {
String commandLine = "io.*NewStringSuite.* -f 1 -wi 10 -i 3 -t 1 -w 2s -r 2s -rf csv";
String commandLine =
"org.apache.fury.*NewStringSuite.* -f 1 -wi 10 -i 3 -t 1 -w 2s -r 2s -rf csv";
System.out.println(commandLine);
args = commandLine.split(" ");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public Object avroDeserialize() throws IOException {

public static void main(String[] args) throws Exception {
if (args.length == 0) {
String commandLine = "io.*RowSuite.* -f 3 -wi 3 -i 3 -t 1 -w 2s -r 2s -rf csv";
String commandLine = "org.apache.fury.*RowSuite.* -f 3 -wi 3 -i 3 -t 1 -w 2s -r 2s -rf csv";
args = commandLine.split(" ");
}
LOG.info("command line: {}", Arrays.toString(args));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public Object flatbuffers_deserialize(FlatBuffersState.FlatBuffersUserTypeState
public static void main(String[] args) throws IOException {
if (args.length == 0) {
String commandLine =
"io.*UserTypeDeserializeSuite.kryo* -f 0 -wi 3 -i 3 -t 1 -w 2s -r 2s -rf csv";
"org.apache.fury.*UserTypeDeserializeSuite.kryo* -f 0 -wi 3 -i 3 -t 1 -w 2s -r 2s -rf csv";
System.out.println(commandLine);
args = commandLine.split(" ");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public Object flatbuffers_serialize(FlatBuffersState.FlatBuffersUserTypeState st
public static void main(String[] args) throws IOException {
if (args.length == 0) {
String commandLine =
"io.*UserTypeSerializeSuite.fury_serialize -f 3 -wi 3 -i 3 -t 1 -w 2s -r 2s -rf csv";
"org.apache.fury.*UserTypeSerializeSuite.fury_serialize -f 3 -wi 3 -i 3 -t 1 -w 2s -r 2s -rf csv";
System.out.println(commandLine);
args = commandLine.split(" ");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ public static void main(String[] args) throws IOException {
jsonBState.setup();

if (args.length == 0) {
String commandLine = "io.*ZeroCopy.*_deserialize$ -f 1 -wi 0 -i 1 -t 1 -w 1s -r 1s -rf csv";
String commandLine =
"org.apache.fury.*ZeroCopy.*_deserialize$ -f 1 -wi 0 -i 1 -t 1 -w 1s -r 1s -rf csv";
System.out.println(commandLine);
args = commandLine.split(" ");
}
Expand Down

0 comments on commit 700181a

Please sign in to comment.