Skip to content

Added cache of type's attributes. #119

Merged
manuc66 merged 6 commits into
manuc66:masterfrom
xzxzxc:cache_type_attributes
Feb 26, 2021
Merged

Added cache of type's attributes. #119
manuc66 merged 6 commits into
manuc66:masterfrom
xzxzxc:cache_type_attributes

Conversation

@xzxzxc
Copy link
Copy Markdown
Contributor

@xzxzxc xzxzxc commented Oct 22, 2020

Added cache of type's attributes. This significantly improves performance in case of deserialization of a large amount of data. In my project it decreased time of deserialization of 300k objects from 27s to 7s.
Used double-checked lock to prevent cоncurrency issues. Didn't use ConcurrentDictionary because there is no such in net3.5.

…oncurrency issues (didn't used ConcurrentDictionary because of there is no such in net3.5).
@sungam3r
Copy link
Copy Markdown

Didn't use ConcurrentDictionary because there is no such in net3.5.

You can solve this with #if TFM

Comment thread JsonSubTypes/JsonSubtypes.cs
@xzxzxc
Copy link
Copy Markdown
Contributor Author

xzxzxc commented Oct 28, 2020

@sungam3r

You can solve this with #if TFM

So, you propose do not add cache for .net 3.5?

@sungam3r
Copy link
Copy Markdown

I mean you can use 'simple' dictionary for net3.5 and ConcurrentDictionary for all other TFMs. But I'm OK with any option you choose.

@xzxzxc
Copy link
Copy Markdown
Contributor Author

xzxzxc commented Oct 28, 2020

@sungam3r, got it. Used ConcurrentDictionary for all other TFMs.

Comment thread JsonSubTypes/JsonSubtypes.cs Outdated
Comment thread JsonSubTypes/JsonSubtypes.cs Outdated
manuc66
manuc66 previously approved these changes Nov 7, 2020
Comment thread JsonSubTypes/JsonSubtypes.cs
@manuc66 manuc66 self-requested a review November 7, 2020 10:55
@manuc66 manuc66 dismissed their stale review November 7, 2020 10:57

Wrong click

@sungam3r
Copy link
Copy Markdown

sungam3r commented Nov 7, 2020

I have doubts about ConditionalWeakTable: dotnet/dotnet-api-docs#1741

@manuc66 manuc66 merged commit e3b2220 into manuc66:master Feb 26, 2021
@manuc66 manuc66 added this to the 1.9.0 milestone Feb 26, 2021
@manuc66
Copy link
Copy Markdown
Owner

manuc66 commented May 9, 2022

Published with version 1.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants