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/fury-site.git
The following commit(s) were added to refs/heads/main by this push:
new 8ad1e39 🔄 synced local 'docs/guide/' with remote 'docs/guide/'
8ad1e39 is described below
commit 8ad1e39581b539bfa4ca8d0e134a4344c3cae5f9
Author: chaokunyang <[email protected]>
AuthorDate: Sat Jul 27 10:29:38 2024 +0000
🔄 synced local 'docs/guide/' with remote 'docs/guide/'
---
docs/guide/java_serialization_guide.md | 32 ++++++++++++++++++++++++++++----
1 file changed, 28 insertions(+), 4 deletions(-)
diff --git a/docs/guide/java_serialization_guide.md
b/docs/guide/java_serialization_guide.md
index 2cca181..de179f4 100644
--- a/docs/guide/java_serialization_guide.md
+++ b/docs/guide/java_serialization_guide.md
@@ -79,10 +79,10 @@ import org.apache.fury.config.*;
public class Example {
// reuse fury.
private static final ThreadSafeFury fury = new ThreadLocalFury(classLoader
-> {
- Fury f = Fury.builder().withLanguage(Language.JAVA)
- .withClassLoader(classLoader).build();
- f.register(SomeClass.class);
- return f;
+ Fury f = Fury.builder().withLanguage(Language.JAVA)
+ .withClassLoader(classLoader).build();
+ f.register(SomeClass.class);
+ return f;
});
public static void main(String[] args) {
@@ -115,6 +115,7 @@ public class Example {
| `codeGenEnabled` | Disabling may result in faster initial
serialization but slower subsequent serializations.
[...]
| `asyncCompilationEnabled` | If enabled, serialization uses
interpreter mode first and switches to JIT serialization after async serializer
JIT for a class is finished.
[...]
| `scalaOptimizationEnabled` | Enables or disables Scala-specific
serialization optimization.
[...]
+| `copyRef` | When disabled, the copy performance
will be better. But fury deep copy will ignore circular and shared reference.
Same reference of an object graph will be copied into different objects in one
`Fury#copy`.
[...]
## Advanced Usage
@@ -192,6 +193,29 @@ not worthy compared to performance cost. Maybe you should
try to disable long co
much
space savings.
+### Object deep copy
+
+Deep copy example:
+
+```java
+Fury fury=Fury.builder()
+ ...
+ .withRefCopy(true).build();
+ SomeClass a=xxx;
+ SomeClass copied=fury.copy(a)
+```
+
+Make fury deep copy ignore circular and shared reference, this deep copy mode
will ignore circular and shared reference.
+Same reference of an object graph will be copied into different objects in one
`Fury#copy`.
+
+```java
+Fury fury=Fury.builder()
+ ...
+ .withRefCopy(false).build();
+ SomeClass a=xxx;
+ SomeClass copied=fury.copy(a)
+```
+
### Implement a customized serializer
In some cases, you may want to implement a serializer for your type,
especially some class customize serialization by
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]