Skip to content
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

Consider caching the result of FSharpType.IsRecord and FSharpType.IsUnion #9

Closed
baronfel opened this issue Aug 8, 2019 · 2 comments
Labels
enhancement New feature or request released: v0.3

Comments

@baronfel
Copy link
Contributor

baronfel commented Aug 8, 2019

Per the implementation here and here, these functions have to use reflection to get type custom attributes, deconstruct them, and do some additional processing. Would it make sense to build a dict of hash(type.FullName) -> bool and check that before delegating to the underlying function for the IsRecord/IsUnion checks that are done as part of CanConvert for the serializers?

@Tarmil
Copy link
Owner

Tarmil commented Aug 8, 2019

Good question, I don't know if CanConvert is called repetitively or only during warmup.

@Tarmil Tarmil added the enhancement New feature or request label Aug 8, 2019
@baronfel
Copy link
Contributor Author

baronfel commented Aug 8, 2019

From what I was reading in the JsonPropertyInfo-createing code, CanConvert will eventually be called for every property of every type that you want to serialize.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released: v0.3
Projects
None yet
Development

No branches or pull requests

2 participants