V14: Remove Newtonsoft from packed projects (#15811)
* Migrate ObjectJsonExtensions * Use more generic exception to not use Newtonsoft It should matter if it's a JsonReaderException, if we can't read we can't read * Remove obsoleted constructors * Use more generic exception in ContentValueSetBuilder * Fix constructors * Remove UdiRangeJsonConverter * Remove more legacy newtonsoft stuff * Migrate away from newtonsoft in CacheInstructionService * Remove unused model binders * Remove more newtonsoft * Remove newtonsoft from DatabaseServerMessenger * Remove now irrelevant benchmark * Remove the usage of Newtonsoft from ImageCropperTemplateCoreExtensions The value converter will never return JObject, JsonDocument, or JsonNode * Remove usages of newtonsoft in ComplexPropertyEditorContentNotificationHandler JTokens are no longer returned, so we don't need to check for it * Remove newtonsoft references * Re-add newtonsoft dependency to Umbraco.Tests.Common * Fix package references * move dependency --------- Co-authored-by: Bjarke Berg <mail@bergmania.dk>
This commit is contained in:
@@ -1,60 +0,0 @@
|
||||
using BenchmarkDotNet.Attributes;
|
||||
using Newtonsoft.Json;
|
||||
using Umbraco.Tests.Benchmarks.Config;
|
||||
|
||||
namespace Umbraco.Tests.Benchmarks;
|
||||
|
||||
[QuickRunConfig]
|
||||
[MemoryDiagnoser]
|
||||
public class JsonSerializerSettingsBenchmarks
|
||||
{
|
||||
[Benchmark]
|
||||
public void SerializerSettingsInstantiation()
|
||||
{
|
||||
var instances = 1000;
|
||||
for (var i = 0; i < instances; i++)
|
||||
{
|
||||
new JsonSerializerSettings();
|
||||
}
|
||||
}
|
||||
|
||||
[Benchmark(Baseline = true)]
|
||||
public void SerializerSettingsSingleInstantiation() => new JsonSerializerSettings();
|
||||
|
||||
// // * Summary *
|
||||
|
||||
// BenchmarkDotNet=v0.11.3, OS=Windows 10.0.18362
|
||||
//Intel Core i5-8265U CPU 1.60GHz(Kaby Lake R), 1 CPU, 8 logical and 4 physical cores
|
||||
// [Host] : .NET Framework 4.7.2 (CLR 4.0.30319.42000), 32bit LegacyJIT-v4.8.4250.0
|
||||
// Job-JIATTD : .NET Framework 4.7.2 (CLR 4.0.30319.42000), 32bit LegacyJIT-v4.8.4250.0
|
||||
|
||||
//IterationCount=3 IterationTime=100.0000 ms LaunchCount = 1
|
||||
//WarmupCount=3
|
||||
|
||||
// Method | Mean | Error | StdDev | Ratio | RatioSD | Gen 0/1k Op | Gen 1/1k Op | Gen 2/1k Op | Allocated Memory/Op |
|
||||
//-------------------------------------- |-------------:|-------------:|------------:|-------:|--------:|------------:|------------:|------------:|--------------------:|
|
||||
// SerializerSettingsInstantiation | 29,120.48 ns | 5,532.424 ns | 303.2508 ns | 997.84 | 23.66 | 73.8122 | - | - | 232346 B |
|
||||
// SerializerSettingsSingleInstantiation | 29.19 ns | 8.089 ns | 0.4434 ns | 1.00 | 0.00 | 0.0738 | - | - | 232 B |
|
||||
|
||||
//// * Warnings *
|
||||
//MinIterationTime
|
||||
// JsonSerializerSettingsBenchmarks.SerializerSettingsSingleInstantiation: IterationCount= 3, IterationTime= 100.0000 ms, LaunchCount= 1, WarmupCount= 3->MinIterationTime = 96.2493 ms which is very small. It's recommended to increase it.
|
||||
|
||||
//// * Legends *
|
||||
// Mean : Arithmetic mean of all measurements
|
||||
// Error : Half of 99.9% confidence interval
|
||||
// StdDev : Standard deviation of all measurements
|
||||
// Ratio : Mean of the ratio distribution ([Current]/[Baseline])
|
||||
// RatioSD : Standard deviation of the ratio distribution([Current]/[Baseline])
|
||||
// Gen 0/1k Op : GC Generation 0 collects per 1k Operations
|
||||
// Gen 1/1k Op : GC Generation 1 collects per 1k Operations
|
||||
// Gen 2/1k Op : GC Generation 2 collects per 1k Operations
|
||||
// Allocated Memory/Op : Allocated memory per single operation(managed only, inclusive, 1KB = 1024B)
|
||||
// 1 ns : 1 Nanosecond(0.000000001 sec)
|
||||
|
||||
//// * Diagnostic Output - MemoryDiagnoser *
|
||||
|
||||
|
||||
// // ***** BenchmarkRunner: End *****
|
||||
// Run time: 00:00:04 (4.88 sec), executed benchmarks: 2
|
||||
}
|
||||
Reference in New Issue
Block a user