You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current clone functionality in OvalBuilder is implemented with Java reflection. Consequently, it is extremely slow and can significantly degrade application performance if invoked frequently. The clone should be rewritten using code weaving. This will be the least disruptive to existing use cases.
Alternatives that were considered included implementing Serializable or using another serialization library (e.g. Jackson). These would require changes to classes being cloned.
The base OvalBuilder should have a public clone method with that throws a OperationNotSupportedException (or some such). The weaver will find subclasses of OvalBuilder and override the method with generated code. Essentially this is copy-constructor generation through a builder.
The existing clone(instance, builder) contract can be expressed with a call to clone builder.clone(instance). The other variant of clone, namely clone(instance), will still need to reflectively instantiate the builder and should be marked deprecated.
The text was updated successfully, but these errors were encountered:
The cloning functionality has been upgraded to use caching of the builder constructor and getter-setter pairs between the type and builder. This has significantly improved performance (~30x). It would likely still be faster to weave the clone functionality. However, the priority of this enhancement has been decreased significantly.
The current clone functionality in OvalBuilder is implemented with Java reflection. Consequently, it is extremely slow and can significantly degrade application performance if invoked frequently. The clone should be rewritten using code weaving. This will be the least disruptive to existing use cases.
Alternatives that were considered included implementing Serializable or using another serialization library (e.g. Jackson). These would require changes to classes being cloned.
The base OvalBuilder should have a public clone method with that throws a OperationNotSupportedException (or some such). The weaver will find subclasses of OvalBuilder and override the method with generated code. Essentially this is copy-constructor generation through a builder.
The existing clone(instance, builder) contract can be expressed with a call to clone builder.clone(instance). The other variant of clone, namely clone(instance), will still need to reflectively instantiate the builder and should be marked deprecated.
The text was updated successfully, but these errors were encountered: