-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Java] Optimize collection serialization protocol by homogenization (#…
…923) * add codegen invocation annotation * optimize collection serialization protocol by homogeneous info * implement interpreter optimized collection read/write * refine jit if/comparator exprs * implement jit collection optimization * add tests * update depth uo make generics push work * fix collection opt jit * add collection nested opt tests * write decl class for meta share * use walkpath to reuse classinfo/holder * fix get classinfo * inline classinfo to get smaller code size * split methods into small methods * add non final object type tests * misc fix * add missing header * fix class resolver test * fix jit method split * update classinfo only for not decl type * Fix method split for collection jit * add map with set elements test * Optimize StringBuilder/StringBuffer serialization (#908) * Optimize StringBuilder/StringBuffer serialization * try to optimize StringBuilder * first to Check code Style * hidden * hidden * bug fix and check code style * delete excess code and add buffers to try testing * fix * try to fix problem * fix function * code fix * code fix again * Update java/fury-core/src/main/java/io/fury/serializer/Serializers.java commit Co-authored-by: Shawn <[email protected]> * Update java/fury-core/src/main/java/io/fury/serializer/Serializers.java commit Co-authored-by: Shawn <[email protected]> --------- Co-authored-by: pankoli <[email protected]> Co-authored-by: Shawn <[email protected]> * Bump release versin to 0.1.2 (#924) * [Doc] add basic type java format doc (#928) add basic type java format doc * [Java] speed test codegen speed by avoid duplicate codegen (#929) * speed test codegen speed by avoid duplicate codegen * fix cache * fix cllass gc * use a standalone lock for every key * refine gc trigger * skip cache for furyGC tests * fix gc tests * lint code * add collection serialization java design doc * update doc * update doc * debug ci * Workaround G1ParScanThreadState::copy_to_survivor_space crash * add iterate array bench results * add benchmark suite * fix jvm g1 workaround * add CollectionSuite header * fix crash * skip unnecessary compress number --------- Co-authored-by: PAN <[email protected]> Co-authored-by: pankoli <[email protected]>
- Loading branch information
1 parent
15af063
commit e8d26d3
Showing
28 changed files
with
1,753 additions
and
502 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Serialization Protocols | ||
- For Java Object Graph Protocol, see [java_object_graph_guide](java_object_graph.md) doc. | ||
- For Cross Language Object Graph Protocol, see [xlang_object_graph_guide](./xlang_object_graph.md) doc. | ||
- For Row Format Protocol, see [row format_guide](./row_format.md) doc. | ||
- For Java Object Graph Protocol, see [java_object_graph_format](java_object_graph.md) doc. | ||
- For Cross Language Object Graph Protocol, see [xlang_object_graph_format](./xlang_object_graph.md) doc. | ||
- For Row Format Protocol, see [row format](./row_format.md) doc. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
java/fury-benchmark/src/main/java/io/fury/benchmark/CollectionSuite.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* Copyright 2023 The Fury Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.fury.benchmark; | ||
|
||
import io.fury.Fury; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
import org.openjdk.jmh.Main; | ||
import org.openjdk.jmh.annotations.Benchmark; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
/** | ||
* Test suite for collection. | ||
* | ||
* @author chaokunyang | ||
*/ | ||
public class CollectionSuite { | ||
private static final Logger LOG = LoggerFactory.getLogger(CollectionSuite.class); | ||
|
||
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"; | ||
System.out.println(commandLine); | ||
args = commandLine.split(" "); | ||
} | ||
Main.main(args); | ||
} | ||
|
||
private static Fury fury = Fury.builder().build(); | ||
private static List<Integer> list1 = new ArrayList<>(1024); | ||
private static byte[] list1Bytes; | ||
|
||
static { | ||
for (int i = 0; i < 1024; i++) { | ||
list1.add(i % 255); | ||
} | ||
list1Bytes = fury.serialize(list1); | ||
LOG.info("Size: {}", list1Bytes.length); | ||
} | ||
|
||
@Benchmark | ||
public Object serializeArrayList() { | ||
return fury.serialize(list1); | ||
} | ||
|
||
@Benchmark | ||
public Object deserializeArrayList() { | ||
return fury.deserialize(list1Bytes); | ||
} | ||
// Benchmark Mode Cnt Score Error Units | ||
// CollectionSuite.deserializeArrayList thrpt 3 175281.624 ± 142913.891 ops/s | ||
// CollectionSuite.serializeArrayList thrpt 3 137648.540 ± 158192.786 ops/s | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
java/fury-core/src/main/java/io/fury/annotation/CodegenInvoke.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright 2023 The Fury Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.fury.annotation; | ||
|
||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
|
||
/** | ||
* An annotation to mark a method will be invoked by generated method. This annotation is used for | ||
* documentation only. | ||
* | ||
* @author chaokunyang | ||
*/ | ||
@Retention(RetentionPolicy.SOURCE) | ||
public @interface CodegenInvoke {} |
Oops, something went wrong.