-
Notifications
You must be signed in to change notification settings - Fork 934
Clean-up of TypeFactory #1483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean-up of TypeFactory #1483
Conversation
I have cancelled the build and enabled concurrency tests. This is done by rewriting |
|
There is no such things in If that is the changes in |
I just cited the neighboring PR ;) |
Yes I know it comes from bahusoid, but does it really apply here? I could remove some syntax update and whitespace fixes, but their are not numerous and not hard to identify. |
* Removing undue global thread sync and concurrency checks, the concurrent dictionary handles already that. * Removing useless singleton pattern, likely a remnant of Java port.
70147d9
to
e904ab7
Compare
Many static methods of
TypeFactory
andSqlTypeFactory
for obtaining types were marked with[MethodImpl(MethodImplOptions.Synchronized)]
, causing a global lock of the type. This was done for protecting the cache of types from concurrent writes. But those methods are since some times implemented with a concurrent dictionary, and are no more needing such a strict synchronization, bad for performances.This change may allow duplicated types to be build when they are not already cached, but only one will be yielded and cached. Those types are lightweight objects without critical resources, having sometime built a dup will not cause troubles.