trampster / JsonSrcGen

Json library that uses .NET 5 Source Generators
MIT License
148 stars 4 forks source link

Decimal type and Project Benchmarks added #45

Closed hugobritobh closed 3 years ago

hugobritobh commented 3 years ago

Project Benchmarks added (with BenchmarkDotNet)

Contains for AttributeSyntax. Example: [assembly: JsonSrcGen.JsonArray(typeof(int))]

Is Number: Details in BenchmarksNumber

Update packages Microsoft.CodeAnalysis.Analyzers (3.3.1) Microsoft.NET.Test.Sdk (16.8.0) NUnit3TestAdapter" Version (3.17.0)

Unit Tests Outcomes 347 Passed 4 Failed (It seems that an error occurred just for me, so it could be a time zone) Do some testing with internationalization (Example: DecimalPropertyTests)

hugobritobh commented 3 years ago

I put the new results: BenchmarksNumber

However, you could accept this version and when uploading the structure version by reference I changed the number verification to the "new method"

trampster commented 3 years ago

Sorry I deleted my comment because the number subtraction method doesn't actually work :(

I realised minutes after posting that it was wrong, so deleted it, but you must have still got it via a notification.

I'll have a good review of this merge request tonight, but currently don't see any reason not to accept it.

This IsNumber method is still slightly slower than the switch for me (I'm on linux) but don't really think it's worth worrying about.

trampster commented 3 years ago

You have left some commented code in your benchmarks. Please remove those.