Skip to content
This repository has been archived by the owner on Nov 8, 2019. It is now read-only.

Use dynamic IL instead of reflection. #157

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

matthid
Copy link
Contributor

@matthid matthid commented Aug 3, 2019

This PR improves performance by some orders of magnitude. At least once the Encoder is cached or on the second call of auto-encoder.

A similar change could probably by done in the decoder, but I'm only using encoders in my scenario.
I tested this on my scenario, but there might be some edge cases where this approach doesn't work, or we need to emit slightly different IL. In these cases, the current code writes an error to the console and uses a fallback logic. We should change this particular logic before merging. Any ideas?

Improves performance by some orders of magnitude. At least once the Encoder is cached or on the second call of auto-encoder.
matthid added a commit to matthid/CSGO-Demo-Manager that referenced this pull request Aug 3, 2019
src/Thoth.Json.Net/Encode.fs Outdated Show resolved Hide resolved
matthid added a commit to matthid/CSGO-Demo-Manager that referenced this pull request Aug 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant