-
Notifications
You must be signed in to change notification settings - Fork 51
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
Exceptions in new version #41
Comments
The goal of collecting all of those exceptions is to make debugging easier. Previously, it was sometimes difficult to tell exactly why something was failing to build. Does your use case require that you generate many serializers/deserializers? There is a performance hit, but only when the delegate is generated—there shouldn’t be any changes in speed of the generated delegates, which is what we’re more concerned about. |
The use case is indeed many (de)serializers. We first thought that was something with the Unsafe nuget package locking up, but now I've created a small sample app and it takes a relatively long time:
The sample is here: https://gist.github.com/promontis/648a9f337706819767c5df7861fac0bc So basically it takes 32 secs to just create the Foo schema, and 7 secs for the null schema. |
That's debug mode btw... will try in release mode. |
A lot faster...
|
This may have to do with tracing/instrumentation. I don’t think debug is inherently that slow; the Chr.Avro.Binary unit tests executing in debug build several hundred delegates and still complete quickly (242 test cases, ~2 seconds). |
I think so too, but I'm not using weird debug settings. Diagnostic tools are disabled. Exceptions settings never stops on exceptions. It is still very slow/unworkable. |
Can you send some details about your environment so we can try to repro (target .NET versions, Visual Studio version, any plugins, etc.)? |
Sure! Windows 10 Enterprise No non-default plugins... though these are loaded (by default):
If you take my gist and run it using the debugger attached, are you getting acceptable results? |
Also very slow for me when referencing source (a project reference to Chr.Avro.Confluent.csproj). When referencing it normally (a package reference to the NuGet release), the debugger doesn’t pick up any of the internal exceptions and the application runs much faster. It’d definitely be possible to implement the case pattern without relying on exceptions, but it would be a significant amount of work and a breaking change for custom cases. Since this doesn’t affect project debugging unless a developer is referencing a local clone of Chr.Avro, I’m not sure it’s worth it. A workaround may be to use |
Cool! I'll finish the PR tomorrow probably... if you can build a prerelease, we can just reference the nuget package and everything should work a lot faster! Thanks for helping out 🤗 |
Hi @dstelljes!
We see a big performance degrade in creating the schema's when switches to master (I think this is 3.0). I think this is because of the many exceptions being thrown in code like:
Such code is located in
JsonSchemaReader
,TypeResolver
,BinarySerializerBuilder
.This is especially performance heavy when the type/schema is located at the end of the array.
For this POCO...
... I'm currently getting 391 exceptions. All handled, but it takes a long time.
The text was updated successfully, but these errors were encountered: