Comments (10)
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 [DebuggerHidden]
or one of the other System.Diagnostics attributes.
from dotnet-avro.
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 🤗
Closing
from dotnet-avro.
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.
from dotnet-avro.
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:
Start CreateProducerForType
Stop CreateProducerForType
CreateProducerForType took: 00:00:32.7368636
Start CreateNullProducer
Stop CreateNullProducer
CreateNullProducer took: 00:00:07.6819759
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.
Is this something you are experiencing as well?
from dotnet-avro.
That's debug mode btw... will try in release mode.
from dotnet-avro.
A lot faster...
Start CreateProducerForType
Stop CreateProducerForType
CreateProducerForType took: 00:00:00.8040465
Start CreateNullProducer
Stop CreateNullProducer
CreateNullProducer took: 00:00:00.0347538
from dotnet-avro.
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).
from dotnet-avro.
This may have to do with tracing/instrumentation
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.
from dotnet-avro.
Can you send some details about your environment so we can try to repro (target .NET versions, Visual Studio version, any plugins, etc.)?
from dotnet-avro.
Sure!
Windows 10 Enterprise
Target .NET Core 2.2
Both Visual Studio 2017/2019 (2019 is even a little bit slower) suffer from this
No non-default plugins... though these are loaded (by default):
- Developer Analytics Tools
- Visual Studio Snapshot Debugger
- Visual Studio IntelliCode
If you take my gist and run it using the debugger attached, are you getting acceptable results?
from dotnet-avro.
Related Issues (20)
- Unable to generate a schema with default values HOT 2
- Default values support in codegen HOT 5
- `[EnumMember]` value should be used when serializing enum types to `"string"`
- Add support for NodaTime HOT 1
- Could not load file or assembly System.ServiceModel.Primitives.dll HOT 1
- Method not found exception HOT 1
- Union with null and multiple selected types throws exception when serializing null. HOT 1
- Exception serializing an anonymous object HOT 3
- No coercion operator is defined between types 'System.String' and 'System.Char[]'. on a simple string property HOT 8
- Exception when building a serializer for type with a missing field from the schema HOT 2
- Support C# records in codegen HOT 1
- Support DateOnly and TimeOnly types
- JSON test failures under NetCore 3.1
- `ArraySegment<T>` deserialization fails on .NET Framework
- Support for Nullable Uri HOT 1
- Support `IgnoreDataMember` attribute
- Support unsigned number as logical types in codegen from Avro HOT 9
- Change to ConstructValueSubjectName HOT 1
- System.Datetime is not handled consistently HOT 1
- Deserialize string to DateOnly fails on net6 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dotnet-avro.