-
Notifications
You must be signed in to change notification settings - Fork 43
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
Use System.Reflection.Emit #15
base: master
Are you sure you want to change the base?
Conversation
Got struct record serialization working, with similar results:
|
Just wanted to say that this PR is very instructional and I'm very hopeful for it! With Npgsql recently releasing support for System.Text.Json for postgresql json/jsonb columns it'd be wonderful to have a more 'safe' serializer for types coming directly from the database. |
16a58f0
to
0822481
Compare
@Tarmil Thought: is it worth packaging out the reflection-emit + type cache into a separate package? It would be nice to use them in other projects as well and share the same instances. |
Yeah, I've considered publishing this as an emit-based non-allocating alternative to |
There's an interesting PR on the dotnet/fsharp repo that might sidestep this PR: dotnet/fsharp#9714 If that gets in, then this repo could just use the new method to generate a mostly-optimized reader func. Still not quite as complete/fast as your implementation here I believe, though. |
This looks like a nice improvement, thanks for the heads up @baronfel ! |
Aaaaand take two is coming already: https://github.com/dotnet/fsharp/pull/9784/files |
Will this be an optional feature if it is implemented? Since the NativeAOT mode of .NET 7 does not support |
As the author of Bolero, which runs on WebAssembly, I fully agree that environments where That being said, as you can see this is quite an old and partial branch, and I really don't know if and when I'll resume work on it anyway. |
Very WIP.
Currently only implemented for record serialization (struct records are failing). It's definitely an improvement over the previous results, especially in terms of runtime but also in terms of allocations (no more
obj[]
):