mirror of
https://github.com/corda/corda.git
synced 2024-12-18 20:47:57 +00:00
ENT-12070 System property feature flag for AMQP Serialization performance improvements (#7838)
This commit is contained in:
parent
852127c648
commit
9bc1ee1ad5
@ -283,12 +283,18 @@ class DefaultLocalSerializerFactory(
|
||||
}
|
||||
|
||||
private val schemaCache = ConcurrentHashMap<Set<TypeNotation>, Pair<Schema, TransformsSchema>>()
|
||||
private val schemaCachingDisabled: Boolean = java.lang.Boolean.getBoolean("net.corda.serialization.disableSchemaCaching")
|
||||
|
||||
override fun getCachedSchema(types: Set<TypeNotation>): Pair<Schema, TransformsSchema> {
|
||||
val cacheKey = CachingSet(types)
|
||||
return schemaCache.getOrPut(cacheKey) {
|
||||
val schema = Schema(cacheKey.toList())
|
||||
return if (schemaCachingDisabled) {
|
||||
val schema = Schema(types.toList())
|
||||
schema to TransformsSchema.build(schema, this)
|
||||
} else {
|
||||
val cacheKey = CachingSet(types)
|
||||
schemaCache.getOrPut(cacheKey) {
|
||||
val schema = Schema(cacheKey.toList())
|
||||
schema to TransformsSchema.build(schema, this)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user