This is an automated email from the ASF dual-hosted git repository.
chaokunyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-fury.git
The following commit(s) were added to refs/heads/main by this push:
new 730c7131 chore(java): add jmh benchmark params to doc (#1488)
730c7131 is described below
commit 730c7131821ebbf99d23bcf1b6325ff966b1ef12
Author: Shawn Yang <[email protected]>
AuthorDate: Thu Apr 11 22:07:42 2024 +0800
chore(java): add jmh benchmark params to doc (#1488)
<!--
**Thanks for contributing to Fury.**
**If this is your first time opening a PR on fury, you can refer to
[CONTRIBUTING.md](https://github.com/apache/incubator-fury/blob/main/CONTRIBUTING.md).**
Contribution Checklist
- The **Apache Fury (incubating)** community has restrictions on the
naming of pr titles. You can also find instructions in
[CONTRIBUTING.md](https://github.com/apache/incubator-fury/blob/main/CONTRIBUTING.md).
- Fury has a strong focus on performance. If the PR you submit will have
an impact on performance, please benchmark it first and provide the
benchmark result here.
-->
## What does this PR do?
<!-- Describe the purpose of this PR. -->
This PR add jmh params to doc, so one can select which benchmark to run
easily for performance optimization
## Related issues
<!--
Is there any related issue? Please attach here.
- #xxxx0
- #xxxx1
- #xxxx2
-->
## Does this PR introduce any user-facing change?
<!--
If any user-facing interface changes, please [open an
issue](https://github.com/apache/incubator-fury/issues/new/choose)
describing the need to do so and update the document if necessary.
-->
- [ ] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?
## Benchmark
<!--
When the PR has an impact on performance (if you don't know whether the
PR will have an impact on performance, you can submit the PR first, and
if it will have impact on performance, the code reviewer will explain
it), be sure to attach a benchmark data here.
-->
---
java/benchmark/README.md | 2 +-
.../java/org/apache/fury/benchmark/UserTypeDeserializeSuite.java | 3 ++-
.../main/java/org/apache/fury/benchmark/UserTypeSerializeSuite.java | 5 +++--
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/java/benchmark/README.md b/java/benchmark/README.md
index 3c3b5c9a..4d152a31 100644
--- a/java/benchmark/README.md
+++ b/java/benchmark/README.md
@@ -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 "org.apache.fury.*\.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 -p objectType=MEDIA_CONTENT -p bufferType=array
-p references=false
```
Generate Protobuf/Flatbuffers code manually:
diff --git
a/java/benchmark/src/main/java/org/apache/fury/benchmark/UserTypeDeserializeSuite.java
b/java/benchmark/src/main/java/org/apache/fury/benchmark/UserTypeDeserializeSuite.java
index 1fe199fd..e9f31411 100644
---
a/java/benchmark/src/main/java/org/apache/fury/benchmark/UserTypeDeserializeSuite.java
+++
b/java/benchmark/src/main/java/org/apache/fury/benchmark/UserTypeDeserializeSuite.java
@@ -136,7 +136,8 @@ public class UserTypeDeserializeSuite {
public static void main(String[] args) throws IOException {
if (args.length == 0) {
String commandLine =
- "org.apache.fury.*UserTypeDeserializeSuite.kryo* -f 0 -wi 3 -i 3 -t
1 -w 2s -r 2s -rf csv";
+ "org.apache.fury.*UserTypeDeserializeSuite.fury* -f 1 -wi 5 -i 10 -t
1 -w 2s -r 2s -rf csv "
+ + "-p objectType=MEDIA_CONTENT -p bufferType=array -p
references=false";
System.out.println(commandLine);
args = commandLine.split(" ");
}
diff --git
a/java/benchmark/src/main/java/org/apache/fury/benchmark/UserTypeSerializeSuite.java
b/java/benchmark/src/main/java/org/apache/fury/benchmark/UserTypeSerializeSuite.java
index 58788ac2..462403fe 100644
---
a/java/benchmark/src/main/java/org/apache/fury/benchmark/UserTypeSerializeSuite.java
+++
b/java/benchmark/src/main/java/org/apache/fury/benchmark/UserTypeSerializeSuite.java
@@ -117,7 +117,7 @@ public class UserTypeSerializeSuite {
return state.bos;
}
- @Benchmark
+ // @Benchmark
public byte[] jsonb_serialize(JsonbState.JsonbUserTypeState state, Blackhole
bh) {
return JsonbState.serialize(bh, state, state.object);
}
@@ -144,7 +144,8 @@ public class UserTypeSerializeSuite {
public static void main(String[] args) throws IOException {
if (args.length == 0) {
String commandLine =
- "org.apache.fury.*UserTypeSerializeSuite.jsonb_serialize -f 3 -wi 3
-i 3 -t 1 -w 2s -r 2s -rf csv";
+ "org.apache.fury.*UserTypeSerializeSuite.fury -f 3 -wi 5 -i 10 -t 1
-w 2s -r 2s -rf csv "
+ + "-p objectType=MEDIA_CONTENT -p bufferType=array -p
references=false";
System.out.println(commandLine);
args = commandLine.split(" ");
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]