timeRefIgnored |
Whether to ignore reference tracking of all time types registered in TimeSerializers and subclasses of those types when ref tracking is enabled. If ignored, ref tracking of every time type can be enabled by invoking Fory#registerSerializer(Class, Serializer). For example, fory.registerSerializer(Date.class, new DateSerializer(fory.getConfig(), true)). Note that enabling ref tracking should happen before serializer codegen of any types which contain time fields. Otherwise, those fields will still skip ref tracking. |
true |
compressInt |
Enables or disables int compression for smaller size. |
true |
compressLong |
Enables or disables long compression for smaller size. |
true |
compressIntArray |
Enables or disables SIMD-accelerated compression for int arrays when values can fit in smaller data types. Requires Java 16+. |
false |
compressLongArray |
Enables or disables SIMD-accelerated compression for long arrays when values can fit in smaller data types. Requires Java 16+. |
false |
compressString |
Enables or disables string compression for smaller size. |
false |
classLoader |
The classloader is fixed per Fory instance because Fory caches class metadata. To use a different loader, create a new Fory or ThreadSafeFory configured with that loader, or rely on the thread context classloader before first class resolution. |
Thread.currentThread().getContextClassLoader() |
compatibleMode |
Type forward/backward compatibility config. Also Related to checkClassVersion config. SCHEMA_CONSISTENT: Class schema must be consistent between serialization peer and deserialization peer. COMPATIBLE: Class schema can be different between serialization peer and deserialization peer. They can add/delete fields independently. See more. |
CompatibleMode.SCHEMA_CONSISTENT |
checkClassVersion |
Determines whether to check the consistency of the class schema. If enabled, Fory checks, writes, and checks consistency using the classVersionHash. It will be automatically disabled when CompatibleMode#COMPATIBLE is enabled. Disabling is not recommended unless you can ensure the class won't evolve. |
false |
checkJdkClassSerializable |
Enables or disables checking of Serializable interface for classes under java.*. If a class under java.* is not Serializable, Fory will throw an UnsupportedOperationException. |
true |
registerGuavaTypes |
Whether to pre-register Guava types such as RegularImmutableMap/RegularImmutableList. These types are not public API, but seem pretty stable. |
true |
requireClassRegistration |
Disabling may allow unknown classes to be deserialized, potentially causing security risks. |
true |
maxDepth |
Set max depth for deserialization, when depth exceeds, an exception will be thrown. This can be used to refuse deserialization DDOS attack. |
50 |
suppressClassRegistrationWarnings |
Whether to suppress class registration warnings. The warnings can be used for security audit, but may be annoying, this suppression will be enabled by default. |
true |
metaShareEnabled |
Enables or disables meta share mode. |
true if CompatibleMode.COMPATIBLE is set, otherwise false. |
scopedMetaShareEnabled |
Scoped meta share focuses on a single serialization process. Metadata created or identified during this process is exclusive to it and is not shared with by other serializations. |
true if CompatibleMode.COMPATIBLE is set, otherwise false. |
metaCompressor |
Set a compressor for meta compression. Note that the passed MetaCompressor should be thread-safe. By default, a Deflater based compressor DeflaterMetaCompressor will be used. Users can pass other compressor such as zstd for better compression rate. |
DeflaterMetaCompressor |
deserializeUnknownClass |
Enables or disables deserialization/skipping of data for non-existent or unknown classes. |
true if CompatibleMode.COMPATIBLE is set, otherwise false. |
codeGenEnabled |
Disabling may result in faster initial serialization but slower subsequent serializations. |
true |
asyncCompilationEnabled |
If enabled, serialization uses interpreter mode first and switches to JIT serialization after async serializer JIT for a class is finished. |
false |
scalaOptimizationEnabled |
Enables or disables Scala-specific serialization optimization. |
false |
copyRef |
When disabled, the copy performance will be better. But fory deep copy will ignore circular and shared reference. Same reference of an object graph will be copied into different objects in one Fory#copy. |
false |
serializeEnumByName |
When Enabled, fory serialize enum by name instead of ordinal. |
false |