diff --git a/INFLUENCES.md b/INFLUENCES.md deleted file mode 100644 index d9333c362..000000000 --- a/INFLUENCES.md +++ /dev/null @@ -1,7 +0,0 @@ -# Influences - -Serilog draws directly on ideas found in: - - * [.NET Framework](https://dot.net) — format string syntax adapted for message templates - * [Apache log4net](https://logging.apache.org/log4net/) — `ILogger` interface, levels, types/namespaces as log sources - * [Enterprise Library Semantic Logging Application Block](https://github.com/microsoftarchive/semantic-logging) (SLAB) — logs-as-event-streams diff --git a/Serilog.sln b/Serilog.sln index 83fe38faa..96ff682c5 100644 --- a/Serilog.sln +++ b/Serilog.sln @@ -17,12 +17,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Serilog", "src\Serilog\Seri EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{290A2775-7CA0-4F81-9DDC-32E28C3A7565}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestDummies", "test\TestDummies\TestDummies.csproj", "{37EF0B5E-0363-4A47-AF3E-51FA6E79E3CF}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Serilog.Tests", "test\Serilog.Tests\Serilog.Tests.csproj", "{B11B911D-977A-42CE-900A-596CF59F6FFA}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Serilog.PerformanceTests", "test\Serilog.PerformanceTests\Serilog.PerformanceTests.csproj", "{B4AC7ED9-517B-47E9-BB49-15F8A8478E62}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -45,18 +41,6 @@ Global {AB00B377-9F1E-4D4B-B6B0-B95F53BCAEF1}.Release|x64.Build.0 = Release|Any CPU {AB00B377-9F1E-4D4B-B6B0-B95F53BCAEF1}.Release|x86.ActiveCfg = Release|Any CPU {AB00B377-9F1E-4D4B-B6B0-B95F53BCAEF1}.Release|x86.Build.0 = Release|Any CPU - {37EF0B5E-0363-4A47-AF3E-51FA6E79E3CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {37EF0B5E-0363-4A47-AF3E-51FA6E79E3CF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {37EF0B5E-0363-4A47-AF3E-51FA6E79E3CF}.Debug|x64.ActiveCfg = Debug|Any CPU - {37EF0B5E-0363-4A47-AF3E-51FA6E79E3CF}.Debug|x64.Build.0 = Debug|Any CPU - {37EF0B5E-0363-4A47-AF3E-51FA6E79E3CF}.Debug|x86.ActiveCfg = Debug|Any CPU - {37EF0B5E-0363-4A47-AF3E-51FA6E79E3CF}.Debug|x86.Build.0 = Debug|Any CPU - {37EF0B5E-0363-4A47-AF3E-51FA6E79E3CF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {37EF0B5E-0363-4A47-AF3E-51FA6E79E3CF}.Release|Any CPU.Build.0 = Release|Any CPU - {37EF0B5E-0363-4A47-AF3E-51FA6E79E3CF}.Release|x64.ActiveCfg = Release|Any CPU - {37EF0B5E-0363-4A47-AF3E-51FA6E79E3CF}.Release|x64.Build.0 = Release|Any CPU - {37EF0B5E-0363-4A47-AF3E-51FA6E79E3CF}.Release|x86.ActiveCfg = Release|Any CPU - {37EF0B5E-0363-4A47-AF3E-51FA6E79E3CF}.Release|x86.Build.0 = Release|Any CPU {B11B911D-977A-42CE-900A-596CF59F6FFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B11B911D-977A-42CE-900A-596CF59F6FFA}.Debug|Any CPU.Build.0 = Debug|Any CPU {B11B911D-977A-42CE-900A-596CF59F6FFA}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -69,27 +53,13 @@ Global {B11B911D-977A-42CE-900A-596CF59F6FFA}.Release|x64.Build.0 = Release|Any CPU {B11B911D-977A-42CE-900A-596CF59F6FFA}.Release|x86.ActiveCfg = Release|Any CPU {B11B911D-977A-42CE-900A-596CF59F6FFA}.Release|x86.Build.0 = Release|Any CPU - {B4AC7ED9-517B-47E9-BB49-15F8A8478E62}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B4AC7ED9-517B-47E9-BB49-15F8A8478E62}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B4AC7ED9-517B-47E9-BB49-15F8A8478E62}.Debug|x64.ActiveCfg = Debug|Any CPU - {B4AC7ED9-517B-47E9-BB49-15F8A8478E62}.Debug|x64.Build.0 = Debug|Any CPU - {B4AC7ED9-517B-47E9-BB49-15F8A8478E62}.Debug|x86.ActiveCfg = Debug|Any CPU - {B4AC7ED9-517B-47E9-BB49-15F8A8478E62}.Debug|x86.Build.0 = Debug|Any CPU - {B4AC7ED9-517B-47E9-BB49-15F8A8478E62}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B4AC7ED9-517B-47E9-BB49-15F8A8478E62}.Release|Any CPU.Build.0 = Release|Any CPU - {B4AC7ED9-517B-47E9-BB49-15F8A8478E62}.Release|x64.ActiveCfg = Release|Any CPU - {B4AC7ED9-517B-47E9-BB49-15F8A8478E62}.Release|x64.Build.0 = Release|Any CPU - {B4AC7ED9-517B-47E9-BB49-15F8A8478E62}.Release|x86.ActiveCfg = Release|Any CPU - {B4AC7ED9-517B-47E9-BB49-15F8A8478E62}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {AB00B377-9F1E-4D4B-B6B0-B95F53BCAEF1} = {791D4267-0D6F-4FDF-80F2-11F4E793B0F2} - {37EF0B5E-0363-4A47-AF3E-51FA6E79E3CF} = {290A2775-7CA0-4F81-9DDC-32E28C3A7565} {B11B911D-977A-42CE-900A-596CF59F6FFA} = {290A2775-7CA0-4F81-9DDC-32E28C3A7565} - {B4AC7ED9-517B-47E9-BB49-15F8A8478E62} = {290A2775-7CA0-4F81-9DDC-32E28C3A7565} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {268F5761-DAC2-4ECA-9AEC-59663B84854C} diff --git a/results/net4.5.2/LevelControlBenchmark-report-github.md b/results/net4.5.2/LevelControlBenchmark-report-github.md deleted file mode 100644 index 66c6b1310..000000000 --- a/results/net4.5.2/LevelControlBenchmark-report-github.md +++ /dev/null @@ -1,20 +0,0 @@ -```ini - -Host Process Environment Information: -BenchmarkDotNet.Core=v0.9.9.0 -OS=Microsoft Windows NT 6.2.9200.0 -Processor=Intel(R) Core(TM) i7-3720QM CPU 2.60GHz, ProcessorCount=8 -Frequency=2533306 ticks, Resolution=394.7411 ns, Timer=TSC -CLR=MS.NET 4.0.30319.42000, Arch=64-bit RELEASE [RyuJIT] -GC=Concurrent Workstation -JitModules=clrjit-v4.6.1080.0 - -Type=LevelControlBenchmark Mode=Throughput - -``` - Method | Median | StdDev | Scaled | Scaled-SD | ---------------- |----------- |---------- |------- |---------- | - Off | 4.1028 ns | 0.0534 ns | 1.00 | 0.00 | - LevelSwitchOff | 4.9870 ns | 0.0728 ns | 1.21 | 0.02 | - MinimumLevelOn | 14.6336 ns | 0.2279 ns | 3.58 | 0.07 | - LevelSwitchOn | 14.0402 ns | 0.2001 ns | 3.42 | 0.07 | diff --git a/results/net4.5.2/LogContextEnrichmentBenchmark-report-github.md b/results/net4.5.2/LogContextEnrichmentBenchmark-report-github.md deleted file mode 100644 index 962671da6..000000000 --- a/results/net4.5.2/LogContextEnrichmentBenchmark-report-github.md +++ /dev/null @@ -1,20 +0,0 @@ -```ini - -Host Process Environment Information: -BenchmarkDotNet.Core=v0.9.9.0 -OS=Microsoft Windows NT 6.2.9200.0 -Processor=Intel(R) Core(TM) i7-3720QM CPU 2.60GHz, ProcessorCount=8 -Frequency=2533306 ticks, Resolution=394.7411 ns, Timer=TSC -CLR=MS.NET 4.0.30319.42000, Arch=64-bit RELEASE [RyuJIT] -GC=Concurrent Workstation -JitModules=clrjit-v4.6.1080.0 - -Type=LogContextEnrichmentBenchmark Mode=Throughput - -``` - Method | Median | StdDev | Scaled | Scaled-SD | ---------------------- |------------ |----------- |------- |---------- | - Bare | 14.5935 ns | 0.2010 ns | 1.00 | 0.00 | - PushProperty | 384.9070 ns | 2.4957 ns | 26.61 | 0.41 | - PushPropertyNested | 778.8093 ns | 51.8017 ns | 55.46 | 3.59 | - PushPropertyEnriched | 598.1650 ns | 12.3394 ns | 41.52 | 1.01 | diff --git a/results/net4.5.2/MessageTemplateCache/MessageTemplateCacheBenchmark_Cached-report-github.md b/results/net4.5.2/MessageTemplateCache/MessageTemplateCacheBenchmark_Cached-report-github.md deleted file mode 100644 index c50909a8e..000000000 --- a/results/net4.5.2/MessageTemplateCache/MessageTemplateCacheBenchmark_Cached-report-github.md +++ /dev/null @@ -1,46 +0,0 @@ -```ini - -Host Process Environment Information: -BenchmarkDotNet.Core=v0.9.9.0 -OS=Microsoft Windows NT 6.2.9200.0 -Processor=Intel(R) Core(TM) i7-4790 CPU 3.60GHz, ProcessorCount=8 -Frequency=3507509 ticks, Resolution=285.1026 ns, Timer=TSC -CLR=MS.NET 4.0.30319.42000, Arch=64-bit RELEASE [RyuJIT] -GC=Concurrent Workstation -JitModules=clrjit-v4.6.1586.0 - -Type=MessageTemplateCacheBenchmark_Cached Mode=Throughput - -``` - Method | Items | MaxDegreeOfParallelism | Median | StdDev | Scaled | Scaled-SD | ------------ |------ |----------------------- |-------------- |----------- |------- |---------- | - **Dictionary** | **10** | **-1** | **479.2330 us** | **8.4171 us** | **1.00** | **0.00** | - Hashtable | 10 | -1 | 31.3853 us | 0.9122 us | 0.07 | 0.00 | - Concurrent | 10 | -1 | 30.8517 us | 0.5337 us | 0.06 | 0.00 | - **Dictionary** | **10** | **1** | **118.6307 us** | **2.1275 us** | **1.00** | **0.00** | - Hashtable | 10 | 1 | 101.8377 us | 3.3030 us | 0.86 | 0.03 | - Concurrent | 10 | 1 | 99.8312 us | 2.0072 us | 0.85 | 0.02 | - **Dictionary** | **20** | **-1** | **814.2458 us** | **4.7079 us** | **1.00** | **0.00** | - Hashtable | 20 | -1 | 54.0605 us | 0.8628 us | 0.07 | 0.00 | - Concurrent | 20 | -1 | 54.0682 us | 1.1269 us | 0.07 | 0.00 | - **Dictionary** | **20** | **1** | **247.6677 us** | **3.9224 us** | **1.00** | **0.00** | - Hashtable | 20 | 1 | 212.1726 us | 7.2594 us | 0.85 | 0.03 | - Concurrent | 20 | 1 | 201.6514 us | 7.5841 us | 0.81 | 0.03 | - **Dictionary** | **50** | **-1** | **1,522.8901 us** | **7.7962 us** | **1.00** | **0.00** | - Hashtable | 50 | -1 | 123.5203 us | 2.2916 us | 0.08 | 0.00 | - Concurrent | 50 | -1 | 121.7588 us | 2.8585 us | 0.08 | 0.00 | - **Dictionary** | **50** | **1** | **591.6731 us** | **5.2648 us** | **1.00** | **0.00** | - Hashtable | 50 | 1 | 515.3277 us | 10.1826 us | 0.87 | 0.02 | - Concurrent | 50 | 1 | 493.4330 us | 4.9567 us | 0.83 | 0.01 | - **Dictionary** | **100** | **-1** | **2,469.4364 us** | **10.4088 us** | **1.00** | **0.00** | - Hashtable | 100 | -1 | 237.0286 us | 2.6360 us | 0.10 | 0.00 | - Concurrent | 100 | -1 | 238.5870 us | 3.0985 us | 0.10 | 0.00 | - **Dictionary** | **100** | **1** | **1,157.9635 us** | **8.0010 us** | **1.00** | **0.00** | - Hashtable | 100 | 1 | 982.2426 us | 16.9287 us | 0.85 | 0.02 | - Concurrent | 100 | 1 | 964.2989 us | 19.8753 us | 0.84 | 0.02 | - **Dictionary** | **1000** | **-1** | **2,479.2089 us** | **10.0258 us** | **1.00** | **0.00** | - Hashtable | 1000 | -1 | 244.9505 us | 3.0286 us | 0.10 | 0.00 | - Concurrent | 1000 | -1 | 239.5800 us | 3.2452 us | 0.10 | 0.00 | - **Dictionary** | **1000** | **1** | **1,164.8552 us** | **6.4559 us** | **1.00** | **0.00** | - Hashtable | 1000 | 1 | 1,002.4865 us | 10.4370 us | 0.86 | 0.01 | - Concurrent | 1000 | 1 | 973.6633 us | 13.2212 us | 0.84 | 0.01 | diff --git a/results/net4.5.2/MessageTemplateCache/MessageTemplateCacheBenchmark_Leaking-report-github.md b/results/net4.5.2/MessageTemplateCache/MessageTemplateCacheBenchmark_Leaking-report-github.md deleted file mode 100644 index a21baf25b..000000000 --- a/results/net4.5.2/MessageTemplateCache/MessageTemplateCacheBenchmark_Leaking-report-github.md +++ /dev/null @@ -1,40 +0,0 @@ -```ini - -Host Process Environment Information: -BenchmarkDotNet.Core=v0.9.9.0 -OS=Microsoft Windows NT 6.2.9200.0 -Processor=Intel(R) Core(TM) i7-4790 CPU 3.60GHz, ProcessorCount=8 -Frequency=3507509 ticks, Resolution=285.1026 ns, Timer=TSC -CLR=MS.NET 4.0.30319.42000, Arch=64-bit RELEASE [RyuJIT] -GC=Concurrent Workstation -JitModules=clrjit-v4.6.1586.0 - -Type=MessageTemplateCacheBenchmark_Leaking Mode=Throughput - -``` - Method | Items | OverflowCount | MaxDegreeOfParallelism | Median | StdDev | Scaled | Scaled-SD | ------------ |------ |-------------- |----------------------- |------------ |----------- |------- |---------- | - **Dictionary** | **10000** | **1** | **-1** | **3.9319 ms** | **0.1209 ms** | **1.00** | **0.00** | - Hashtable | 10000 | 1 | -1 | 3.3042 ms | 0.1371 ms | 0.83 | 0.04 | - Concurrent | 10000 | 1 | -1 | 92.5456 ms | 6.2102 ms | 23.77 | 1.73 | - **Dictionary** | **10000** | **1** | **1** | **2.0104 ms** | **0.0072 ms** | **1.00** | **0.00** | - Hashtable | 10000 | 1 | 1 | 2.0956 ms | 0.0115 ms | 1.04 | 0.01 | - Concurrent | 10000 | 1 | 1 | 176.4643 ms | 1.1110 ms | 87.81 | 0.62 | - **Dictionary** | **10000** | **10** | **-1** | **4.0999 ms** | **0.1572 ms** | **1.00** | **0.00** | - Hashtable | 10000 | 10 | -1 | 3.2378 ms | 0.0898 ms | 0.79 | 0.04 | - Concurrent | 10000 | 10 | -1 | 99.3250 ms | 7.0231 ms | 24.21 | 1.93 | - **Dictionary** | **10000** | **10** | **1** | **2.0057 ms** | **0.0085 ms** | **1.00** | **0.00** | - Hashtable | 10000 | 10 | 1 | 2.0805 ms | 0.0107 ms | 1.04 | 0.01 | - Concurrent | 10000 | 10 | 1 | 176.0989 ms | 0.9909 ms | 87.83 | 0.60 | - **Dictionary** | **10000** | **100** | **-1** | **4.2080 ms** | **0.1332 ms** | **1.00** | **0.00** | - Hashtable | 10000 | 100 | -1 | 3.1794 ms | 0.1479 ms | 0.77 | 0.04 | - Concurrent | 10000 | 100 | -1 | 116.0221 ms | 8.9935 ms | 27.49 | 2.28 | - **Dictionary** | **10000** | **100** | **1** | **2.0018 ms** | **0.0070 ms** | **1.00** | **0.00** | - Hashtable | 10000 | 100 | 1 | 2.0884 ms | 0.0116 ms | 1.04 | 0.01 | - Concurrent | 10000 | 100 | 1 | 177.2720 ms | 0.9531 ms | 88.50 | 0.55 | - **Dictionary** | **10000** | **1000** | **-1** | **4.4081 ms** | **0.1243 ms** | **1.00** | **0.00** | - Hashtable | 10000 | 1000 | -1 | 3.7401 ms | 0.2270 ms | 0.87 | 0.06 | - Concurrent | 10000 | 1000 | -1 | 201.6415 ms | 28.0265 ms | 45.39 | 6.50 | - **Dictionary** | **10000** | **1000** | **1** | **2.0047 ms** | **0.0061 ms** | **1.00** | **0.00** | - Hashtable | 10000 | 1000 | 1 | 2.0889 ms | 0.0116 ms | 1.04 | 0.01 | - Concurrent | 10000 | 1000 | 1 | 176.6271 ms | 1.3462 ms | 88.05 | 0.70 | diff --git a/results/net4.5.2/MessageTemplateParsingBenchmark-report-github.md b/results/net4.5.2/MessageTemplateParsingBenchmark-report-github.md deleted file mode 100644 index 086cdfd5e..000000000 --- a/results/net4.5.2/MessageTemplateParsingBenchmark-report-github.md +++ /dev/null @@ -1,18 +0,0 @@ -```ini - -Host Process Environment Information: -BenchmarkDotNet.Core=v0.9.9.0 -OS=Microsoft Windows NT 6.2.9200.0 -Processor=Intel(R) Core(TM) i7-3720QM CPU 2.60GHz, ProcessorCount=8 -Frequency=2533306 ticks, Resolution=394.7411 ns, Timer=TSC -CLR=MS.NET 4.0.30319.42000, Arch=64-bit RELEASE [RyuJIT] -GC=Concurrent Workstation -JitModules=clrjit-v4.6.1080.0 - -Type=MessageTemplateParsingBenchmark Mode=Throughput - -``` - Method | Median | StdDev | Scaled | Scaled-SD | ------------------------------ |-------------- |----------- |------- |---------- | - EmptyTemplate | 183.3209 ns | 3.9928 ns | 1.00 | 0.00 | - DefaultConsoleOutputTemplate | 2,636.2172 ns | 77.3304 ns | 14.40 | 0.50 | diff --git a/results/net4.5.2/NestedLoggerCreationBenchmark-report-github.md b/results/net4.5.2/NestedLoggerCreationBenchmark-report-github.md deleted file mode 100644 index 620c50bb9..000000000 --- a/results/net4.5.2/NestedLoggerCreationBenchmark-report-github.md +++ /dev/null @@ -1,18 +0,0 @@ -```ini - -Host Process Environment Information: -BenchmarkDotNet.Core=v0.9.9.0 -OS=Microsoft Windows NT 6.2.9200.0 -Processor=Intel(R) Core(TM) i7-3720QM CPU 2.60GHz, ProcessorCount=8 -Frequency=2533306 ticks, Resolution=394.7411 ns, Timer=TSC -CLR=MS.NET 4.0.30319.42000, Arch=64-bit RELEASE [RyuJIT] -GC=Concurrent Workstation -JitModules=clrjit-v4.6.1080.0 - -Type=NestedLoggerCreationBenchmark Mode=Throughput - -``` - Method | Median | StdDev | ------------------ |------------ |---------- | - ForContextString | 91.0471 ns | 0.5325 ns | - ForContextType | 159.5909 ns | 1.3952 ns | diff --git a/results/net4.5.2/NestedLoggerLatencyBenchmark-report-github.md b/results/net4.5.2/NestedLoggerLatencyBenchmark-report-github.md deleted file mode 100644 index b2715a85b..000000000 --- a/results/net4.5.2/NestedLoggerLatencyBenchmark-report-github.md +++ /dev/null @@ -1,18 +0,0 @@ -```ini - -Host Process Environment Information: -BenchmarkDotNet.Core=v0.9.9.0 -OS=Microsoft Windows NT 6.2.9200.0 -Processor=Intel(R) Core(TM) i7-3720QM CPU 2.60GHz, ProcessorCount=8 -Frequency=2533306 ticks, Resolution=394.7411 ns, Timer=TSC -CLR=MS.NET 4.0.30319.42000, Arch=64-bit RELEASE [RyuJIT] -GC=Concurrent Workstation -JitModules=clrjit-v4.6.1080.0 - -Type=NestedLoggerLatencyBenchmark Mode=Throughput - -``` - Method | Median | StdDev | Scaled | Scaled-SD | -------------- |----------- |---------- |------- |---------- | - RootLogger | 14.5315 ns | 0.6035 ns | 1.00 | 0.00 | - NestedLogger | 52.6109 ns | 1.0453 ns | 3.60 | 0.15 | diff --git a/results/net4.5.2/PipelineBenchmark-report-github.md b/results/net4.5.2/PipelineBenchmark-report-github.md deleted file mode 100644 index 659d6d488..000000000 --- a/results/net4.5.2/PipelineBenchmark-report-github.md +++ /dev/null @@ -1,17 +0,0 @@ -```ini - -Host Process Environment Information: -BenchmarkDotNet.Core=v0.9.9.0 -OS=Microsoft Windows NT 6.2.9200.0 -Processor=Intel(R) Core(TM) i7-3720QM CPU 2.60GHz, ProcessorCount=8 -Frequency=2533306 ticks, Resolution=394.7411 ns, Timer=TSC -CLR=MS.NET 4.0.30319.42000, Arch=64-bit RELEASE [RyuJIT] -GC=Concurrent Workstation -JitModules=clrjit-v4.6.1080.0 - -Type=PipelineBenchmark Mode=Throughput - -``` - Method | Median | StdDev | -------------- |------------ |---------- | - EmitLogEvent | 419.2931 ns | 4.3815 ns | diff --git a/results/net46/AllocationsBenchmark-report-github.md b/results/net46/AllocationsBenchmark-report-github.md deleted file mode 100644 index d40893e56..000000000 --- a/results/net46/AllocationsBenchmark-report-github.md +++ /dev/null @@ -1,18 +0,0 @@ -``` ini - -BenchmarkDotNet=v0.10.6, OS=Windows 10 Redstone 1 (10.0.14393) -Processor=Intel Core i7-4790 CPU 3.60GHz (Haswell), ProcessorCount=8 -Frequency=3507500 Hz, Resolution=285.1033 ns, Timer=TSC - [Host] : Clr 4.0.30319.42000, 32bit LegacyJIT-v4.7.2053.0 - DefaultJob : Clr 4.0.30319.42000, 32bit LegacyJIT-v4.7.2053.0 - - -``` - | Method | Mean | Error | StdDev | Scaled | ScaledSD | Gen 0 | Allocated | - |--------------------- |-------------:|-----------:|-----------:|-------:|---------:|-------:|----------:| - | LogEmpty | 9.749 ns | 0.0346 ns | 0.0324 ns | 1.00 | 0.00 | - | 0 B | - | LogEmptyWithEnricher | 103.460 ns | 0.1742 ns | 0.1629 ns | 10.61 | 0.04 | 0.0066 | 28 B | - | LogScalar | 478.723 ns | 0.6996 ns | 0.6201 ns | 49.11 | 0.17 | 0.0591 | 248 B | - | LogDictionary | 3,867.137 ns | 13.5751 ns | 12.6982 ns | 396.67 | 1.79 | 0.3128 | 1324 B | - | LogSequence | 1,309.241 ns | 1.4345 ns | 1.3418 ns | 134.30 | 0.45 | 0.1144 | 484 B | - | LogAnonymous | 6,128.421 ns | 11.3529 ns | 10.6195 ns | 628.62 | 2.28 | 0.4654 | 1960 B | diff --git a/results/netcoreapp1.0/LevelControlBenchmark-report-github.md b/results/netcoreapp1.0/LevelControlBenchmark-report-github.md deleted file mode 100644 index 4e18aec9e..000000000 --- a/results/netcoreapp1.0/LevelControlBenchmark-report-github.md +++ /dev/null @@ -1,20 +0,0 @@ -```ini - -Host Process Environment Information: -BenchmarkDotNet.Core=v0.9.9.0 -OS=Windows -Processor=?, ProcessorCount=8 -Frequency=2533306 ticks, Resolution=394.7411 ns, Timer=TSC -CLR=CORE, Arch=64-bit ? [RyuJIT] -GC=Concurrent Workstation -dotnet cli version: 1.0.0-preview2-003121 - -Type=LevelControlBenchmark Mode=Throughput - -``` - Method | Median | StdDev | Scaled | Scaled-SD | ---------------- |----------- |---------- |------- |---------- | - Off | 4.1095 ns | 0.1013 ns | 1.00 | 0.00 | - LevelSwitchOff | 4.9570 ns | 0.0807 ns | 1.20 | 0.03 | - MinimumLevelOn | 14.5884 ns | 0.1821 ns | 3.54 | 0.10 | - LevelSwitchOn | 13.9769 ns | 0.1802 ns | 3.38 | 0.09 | diff --git a/results/netcoreapp1.0/LogContextEnrichmentBenchmark-report-github.md b/results/netcoreapp1.0/LogContextEnrichmentBenchmark-report-github.md deleted file mode 100644 index 918e58f9f..000000000 --- a/results/netcoreapp1.0/LogContextEnrichmentBenchmark-report-github.md +++ /dev/null @@ -1,20 +0,0 @@ -```ini - -Host Process Environment Information: -BenchmarkDotNet.Core=v0.9.9.0 -OS=Windows -Processor=?, ProcessorCount=8 -Frequency=2533306 ticks, Resolution=394.7411 ns, Timer=TSC -CLR=CORE, Arch=64-bit ? [RyuJIT] -GC=Concurrent Workstation -dotnet cli version: 1.0.0-preview2-003121 - -Type=LogContextEnrichmentBenchmark Mode=Throughput - -``` - Method | Median | StdDev | Scaled | Scaled-SD | ---------------------- |------------ |----------- |------- |---------- | - Bare | 14.3441 ns | 0.2826 ns | 1.00 | 0.00 | - PushProperty | 450.5621 ns | 3.2270 ns | 31.42 | 0.65 | - PushPropertyNested | 920.1179 ns | 45.1624 ns | 63.81 | 3.30 | - PushPropertyEnriched | 730.4018 ns | 4.5812 ns | 50.92 | 1.03 | diff --git a/results/netcoreapp1.0/MessageTemplateCache/MessageTemplateCacheBenchmark_Cached-report-github.md b/results/netcoreapp1.0/MessageTemplateCache/MessageTemplateCacheBenchmark_Cached-report-github.md deleted file mode 100644 index 1b299e7ac..000000000 --- a/results/netcoreapp1.0/MessageTemplateCache/MessageTemplateCacheBenchmark_Cached-report-github.md +++ /dev/null @@ -1,46 +0,0 @@ -```ini - -Host Process Environment Information: -BenchmarkDotNet.Core=v0.9.9.0 -OS=Windows -Processor=?, ProcessorCount=8 -Frequency=3507509 ticks, Resolution=285.1026 ns, Timer=TSC -CLR=CORE, Arch=64-bit ? [RyuJIT] -GC=Concurrent Workstation -dotnet cli version: 1.0.0-preview2-003131 - -Type=MessageTemplateCacheBenchmark_Cached Mode=Throughput - -``` - Method | Items | MaxDegreeOfParallelism | Median | StdDev | Scaled | Scaled-SD | ------------ |------ |----------------------- |-------------- |----------- |------- |---------- | - **Dictionary** | **10** | **-1** | **471.8337 us** | **12.2518 us** | **1.00** | **0.00** | - Hashtable | 10 | -1 | 30.1689 us | 0.6795 us | 0.06 | 0.00 | - Concurrent | 10 | -1 | 29.0805 us | 0.1960 us | 0.06 | 0.00 | - **Dictionary** | **10** | **1** | **130.2107 us** | **3.1653 us** | **1.00** | **0.00** | - Hashtable | 10 | 1 | 122.2643 us | 2.4861 us | 0.94 | 0.03 | - Concurrent | 10 | 1 | 111.4388 us | 1.5693 us | 0.86 | 0.02 | - **Dictionary** | **20** | **-1** | **807.0063 us** | **2.6482 us** | **1.00** | **0.00** | - Hashtable | 20 | -1 | 52.2398 us | 1.0080 us | 0.06 | 0.00 | - Concurrent | 20 | -1 | 51.2831 us | 0.3521 us | 0.06 | 0.00 | - **Dictionary** | **20** | **1** | **259.5397 us** | **7.4273 us** | **1.00** | **0.00** | - Hashtable | 20 | 1 | 245.7154 us | 7.1712 us | 0.94 | 0.04 | - Concurrent | 20 | 1 | 222.5680 us | 2.6695 us | 0.85 | 0.02 | - **Dictionary** | **50** | **-1** | **1,296.5404 us** | **21.9341 us** | **1.00** | **0.00** | - Hashtable | 50 | -1 | 121.7466 us | 1.9856 us | 0.09 | 0.00 | - Concurrent | 50 | -1 | 117.7603 us | 0.9613 us | 0.09 | 0.00 | - **Dictionary** | **50** | **1** | **650.9873 us** | **8.5592 us** | **1.00** | **0.00** | - Hashtable | 50 | 1 | 615.8303 us | 11.6568 us | 0.94 | 0.02 | - Concurrent | 50 | 1 | 557.0763 us | 6.8188 us | 0.86 | 0.02 | - **Dictionary** | **100** | **-1** | **2,330.0390 us** | **10.0342 us** | **1.00** | **0.00** | - Hashtable | 100 | -1 | 235.0997 us | 3.6531 us | 0.10 | 0.00 | - Concurrent | 100 | -1 | 227.1950 us | 2.0706 us | 0.10 | 0.00 | - **Dictionary** | **100** | **1** | **1,306.6364 us** | **60.9756 us** | **1.00** | **0.00** | - Hashtable | 100 | 1 | 1,214.4314 us | 18.8564 us | 0.92 | 0.04 | - Concurrent | 100 | 1 | 1,113.6760 us | 8.7944 us | 0.84 | 0.04 | - **Dictionary** | **1000** | **-1** | **2,338.3248 us** | **20.7148 us** | **1.00** | **0.00** | - Hashtable | 1000 | -1 | 238.6618 us | 1.8611 us | 0.10 | 0.00 | - Concurrent | 1000 | -1 | 232.2733 us | 1.5743 us | 0.10 | 0.00 | - **Dictionary** | **1000** | **1** | **1,311.6107 us** | **12.7315 us** | **1.00** | **0.00** | - Hashtable | 1000 | 1 | 1,246.3194 us | 8.1155 us | 0.95 | 0.01 | - Concurrent | 1000 | 1 | 1,136.7721 us | 15.0574 us | 0.87 | 0.01 | diff --git a/results/netcoreapp1.0/MessageTemplateCache/MessageTemplateCacheBenchmark_Leaking-report-github.md b/results/netcoreapp1.0/MessageTemplateCache/MessageTemplateCacheBenchmark_Leaking-report-github.md deleted file mode 100644 index e8207b26d..000000000 --- a/results/netcoreapp1.0/MessageTemplateCache/MessageTemplateCacheBenchmark_Leaking-report-github.md +++ /dev/null @@ -1,40 +0,0 @@ -```ini - -Host Process Environment Information: -BenchmarkDotNet.Core=v0.9.9.0 -OS=Windows -Processor=?, ProcessorCount=8 -Frequency=3507509 ticks, Resolution=285.1026 ns, Timer=TSC -CLR=CORE, Arch=64-bit ? [RyuJIT] -GC=Concurrent Workstation -dotnet cli version: 1.0.0-preview2-003131 - -Type=MessageTemplateCacheBenchmark_Leaking Mode=Throughput - -``` - Method | Items | OverflowCount | MaxDegreeOfParallelism | Median | StdDev | Scaled | Scaled-SD | ------------ |------ |-------------- |----------------------- |------------ |----------- |------- |---------- | - **Dictionary** | **10000** | **1** | **-1** | **3.9183 ms** | **0.1968 ms** | **1.00** | **0.00** | - Hashtable | 10000 | 1 | -1 | 2.1291 ms | 0.0444 ms | 0.55 | 0.03 | - Concurrent | 10000 | 1 | -1 | 69.0551 ms | 5.2627 ms | 17.73 | 1.59 | - **Dictionary** | **10000** | **1** | **1** | **2.3437 ms** | **0.0091 ms** | **1.00** | **0.00** | - Hashtable | 10000 | 1 | 1 | 2.4470 ms | 0.0135 ms | 1.04 | 0.01 | - Concurrent | 10000 | 1 | 1 | 167.0585 ms | 1.3400 ms | 71.17 | 0.62 | - **Dictionary** | **10000** | **10** | **-1** | **3.9524 ms** | **0.2059 ms** | **1.00** | **0.00** | - Hashtable | 10000 | 10 | -1 | 2.2075 ms | 0.0741 ms | 0.56 | 0.03 | - Concurrent | 10000 | 10 | -1 | 77.3839 ms | 9.4562 ms | 19.32 | 2.57 | - **Dictionary** | **10000** | **10** | **1** | **2.3351 ms** | **0.0081 ms** | **1.00** | **0.00** | - Hashtable | 10000 | 10 | 1 | 2.4537 ms | 0.0128 ms | 1.05 | 0.01 | - Concurrent | 10000 | 10 | 1 | 166.3683 ms | 1.7963 ms | 71.21 | 0.79 | - **Dictionary** | **10000** | **100** | **-1** | **4.0189 ms** | **0.1066 ms** | **1.00** | **0.00** | - Hashtable | 10000 | 100 | -1 | 2.4080 ms | 0.0545 ms | 0.60 | 0.02 | - Concurrent | 10000 | 100 | -1 | 95.7208 ms | 12.9543 ms | 22.97 | 3.26 | - **Dictionary** | **10000** | **100** | **1** | **2.3307 ms** | **0.0147 ms** | **1.00** | **0.00** | - Hashtable | 10000 | 100 | 1 | 2.4447 ms | 0.0132 ms | 1.05 | 0.01 | - Concurrent | 10000 | 100 | 1 | 165.2893 ms | 1.0848 ms | 70.90 | 0.63 | - **Dictionary** | **10000** | **1000** | **-1** | **4.3837 ms** | **0.1868 ms** | **1.00** | **0.00** | - Hashtable | 10000 | 1000 | -1 | 3.3281 ms | 0.1305 ms | 0.77 | 0.04 | - Concurrent | 10000 | 1000 | -1 | 178.7427 ms | 34.4240 ms | 40.66 | 8.10 | - **Dictionary** | **10000** | **1000** | **1** | **2.3404 ms** | **0.0208 ms** | **1.00** | **0.00** | - Hashtable | 10000 | 1000 | 1 | 2.4727 ms | 0.0146 ms | 1.05 | 0.01 | - Concurrent | 10000 | 1000 | 1 | 165.6182 ms | 1.1273 ms | 70.66 | 0.77 | diff --git a/results/netcoreapp1.0/MessageTemplateParsingBenchmark-report-github.md b/results/netcoreapp1.0/MessageTemplateParsingBenchmark-report-github.md deleted file mode 100644 index 99f76d5ca..000000000 --- a/results/netcoreapp1.0/MessageTemplateParsingBenchmark-report-github.md +++ /dev/null @@ -1,18 +0,0 @@ -```ini - -Host Process Environment Information: -BenchmarkDotNet.Core=v0.9.9.0 -OS=Windows -Processor=?, ProcessorCount=8 -Frequency=2533306 ticks, Resolution=394.7411 ns, Timer=TSC -CLR=CORE, Arch=64-bit ? [RyuJIT] -GC=Concurrent Workstation -dotnet cli version: 1.0.0-preview2-003121 - -Type=MessageTemplateParsingBenchmark Mode=Throughput - -``` - Method | Median | StdDev | Scaled | Scaled-SD | ------------------------------ |-------------- |----------- |------- |---------- | - EmptyTemplate | 188.2760 ns | 2.4773 ns | 1.00 | 0.00 | - DefaultConsoleOutputTemplate | 2,753.6243 ns | 22.7107 ns | 14.54 | 0.22 | diff --git a/results/netcoreapp1.0/NestedLoggerCreationBenchmark-report-github.md b/results/netcoreapp1.0/NestedLoggerCreationBenchmark-report-github.md deleted file mode 100644 index 39ae09e76..000000000 --- a/results/netcoreapp1.0/NestedLoggerCreationBenchmark-report-github.md +++ /dev/null @@ -1,18 +0,0 @@ -```ini - -Host Process Environment Information: -BenchmarkDotNet.Core=v0.9.9.0 -OS=Windows -Processor=?, ProcessorCount=8 -Frequency=2533306 ticks, Resolution=394.7411 ns, Timer=TSC -CLR=CORE, Arch=64-bit ? [RyuJIT] -GC=Concurrent Workstation -dotnet cli version: 1.0.0-preview2-003121 - -Type=NestedLoggerCreationBenchmark Mode=Throughput - -``` - Method | Median | StdDev | ------------------ |------------ |---------- | - ForContextString | 92.1957 ns | 0.8786 ns | - ForContextType | 155.5276 ns | 0.8364 ns | diff --git a/results/netcoreapp1.0/NestedLoggerLatencyBenchmark-report-github.md b/results/netcoreapp1.0/NestedLoggerLatencyBenchmark-report-github.md deleted file mode 100644 index bceb35026..000000000 --- a/results/netcoreapp1.0/NestedLoggerLatencyBenchmark-report-github.md +++ /dev/null @@ -1,18 +0,0 @@ -```ini - -Host Process Environment Information: -BenchmarkDotNet.Core=v0.9.9.0 -OS=Windows -Processor=?, ProcessorCount=8 -Frequency=2533306 ticks, Resolution=394.7411 ns, Timer=TSC -CLR=CORE, Arch=64-bit ? [RyuJIT] -GC=Concurrent Workstation -dotnet cli version: 1.0.0-preview2-003121 - -Type=NestedLoggerLatencyBenchmark Mode=Throughput - -``` - Method | Median | StdDev | Scaled | Scaled-SD | -------------- |----------- |---------- |------- |---------- | - RootLogger | 14.0131 ns | 0.2212 ns | 1.00 | 0.00 | - NestedLogger | 59.4502 ns | 1.3198 ns | 4.23 | 0.11 | diff --git a/results/netcoreapp1.0/PipelineBenchmark-report-github.md b/results/netcoreapp1.0/PipelineBenchmark-report-github.md deleted file mode 100644 index 37743f9ba..000000000 --- a/results/netcoreapp1.0/PipelineBenchmark-report-github.md +++ /dev/null @@ -1,17 +0,0 @@ -```ini - -Host Process Environment Information: -BenchmarkDotNet.Core=v0.9.9.0 -OS=Windows -Processor=?, ProcessorCount=8 -Frequency=2533306 ticks, Resolution=394.7411 ns, Timer=TSC -CLR=CORE, Arch=64-bit ? [RyuJIT] -GC=Concurrent Workstation -dotnet cli version: 1.0.0-preview2-003121 - -Type=PipelineBenchmark Mode=Throughput - -``` - Method | Median | StdDev | -------------- |------------ |---------- | - EmitLogEvent | 712.9876 ns | 7.2272 ns | diff --git a/results/netcoreapp1.1/AllocationsBenchmark-report-github.md b/results/netcoreapp1.1/AllocationsBenchmark-report-github.md deleted file mode 100644 index 369846ee3..000000000 --- a/results/netcoreapp1.1/AllocationsBenchmark-report-github.md +++ /dev/null @@ -1,19 +0,0 @@ -``` ini - -BenchmarkDotNet=v0.10.6, OS=Windows 10 Redstone 1 (10.0.14393) -Processor=Intel Core i7-4790 CPU 3.60GHz (Haswell), ProcessorCount=8 -Frequency=3507500 Hz, Resolution=285.1033 ns, Timer=TSC -dotnet cli version=2.0.0-preview1-005977 - [Host] : .NET Core 4.6.25211.01, 64bit RyuJIT - DefaultJob : .NET Core 4.6.25211.01, 64bit RyuJIT - - -``` - | Method | Mean | Error | StdDev | Scaled | ScaledSD | Gen 0 | Allocated | - |--------------------- |-------------:|-----------:|-----------:|-------:|---------:|-------:|----------:| - | LogEmpty | 8.652 ns | 0.0230 ns | 0.0215 ns | 1.00 | 0.00 | - | 0 B | - | LogEmptyWithEnricher | 104.790 ns | 0.4970 ns | 0.4405 ns | 12.11 | 0.06 | 0.0132 | 56 B | - | LogScalar | 432.424 ns | 0.6263 ns | 0.5858 ns | 49.98 | 0.14 | 0.1030 | 432 B | - | LogDictionary | 3,887.068 ns | 4.4649 ns | 3.7284 ns | 449.26 | 1.16 | 0.5417 | 2296 B | - | LogSequence | 1,428.896 ns | 3.6324 ns | 3.2200 ns | 165.15 | 0.53 | 0.2079 | 880 B | - | LogAnonymous | 6,694.431 ns | 22.4848 ns | 21.0323 ns | 773.73 | 3.00 | 0.8392 | 3528 B | diff --git a/results/netcoreapp2.0/AllocationsBenchmark-report-github.md b/results/netcoreapp2.0/AllocationsBenchmark-report-github.md deleted file mode 100644 index 8c071d87a..000000000 --- a/results/netcoreapp2.0/AllocationsBenchmark-report-github.md +++ /dev/null @@ -1,19 +0,0 @@ -``` ini - -BenchmarkDotNet=v0.10.6, OS=Mac OS X 10.12 -Processor=Intel Core i7-7567U CPU 3.50GHz (Kaby Lake), ProcessorCount=4 -Frequency=1000000000 Hz, Resolution=1.0000 ns, Timer=UNKNOWN -dotnet cli version=2.1.4 - [Host] : .NET Core 4.6.0.0, 64bit RyuJIT - DefaultJob : .NET Core 4.6.0.0, 64bit RyuJIT - - -``` - | Method | Mean | Error | StdDev | Median | Scaled | ScaledSD | Gen 0 | Allocated | - |--------------------- |--------------:|------------:|--------------:|--------------:|---------:|---------:|-------:|----------:| - | LogEmpty | 8.295 ns | 0.1916 ns | 0.1882 ns | 8.251 ns | 1.00 | 0.00 | - | 0 B | - | LogEmptyWithEnricher | 129.205 ns | 4.7752 ns | 13.5464 ns | 126.329 ns | 15.58 | 1.66 | 0.0265 | 56 B | - | LogScalar | 998.006 ns | 19.7947 ns | 48.5568 ns | 993.968 ns | 120.37 | 6.37 | 0.2060 | 432 B | - | LogDictionary | 6,418.543 ns | 142.5459 ns | 418.0626 ns | 6,304.087 ns | 774.13 | 52.90 | 1.0910 | 2296 B | - | LogSequence | 2,664.592 ns | 52.9768 ns | 145.9136 ns | 2,655.944 ns | 321.37 | 18.83 | 0.4158 | 880 B | - | LogAnonymous | 12,776.209 ns | 378.7175 ns | 1,110.7127 ns | 12,563.375 ns | 1,540.91 | 137.42 | 1.6785 | 3528 B | diff --git a/results/netcoreapp2.0/LevelControlBenchmark-report-github.md b/results/netcoreapp2.0/LevelControlBenchmark-report-github.md deleted file mode 100644 index 39897845d..000000000 --- a/results/netcoreapp2.0/LevelControlBenchmark-report-github.md +++ /dev/null @@ -1,17 +0,0 @@ -``` ini - -BenchmarkDotNet=v0.10.6, OS=Mac OS X 10.12 -Processor=Intel Core i7-7567U CPU 3.50GHz (Kaby Lake), ProcessorCount=4 -Frequency=1000000000 Hz, Resolution=1.0000 ns, Timer=UNKNOWN -dotnet cli version=2.1.4 - [Host] : .NET Core 4.6.0.0, 64bit RyuJIT - DefaultJob : .NET Core 4.6.0.0, 64bit RyuJIT - - -``` - | Method | Mean | Error | StdDev | Scaled | ScaledSD | - |--------------- |----------:|----------:|----------:|-------:|---------:| - | Off | 2.931 ns | 0.0893 ns | 0.0877 ns | 1.00 | 0.00 | - | LevelSwitchOff | 3.636 ns | 0.1048 ns | 0.1029 ns | 1.24 | 0.05 | - | MinimumLevelOn | 10.497 ns | 0.2462 ns | 0.3370 ns | 3.58 | 0.15 | - | LevelSwitchOn | 10.981 ns | 0.3005 ns | 0.3340 ns | 3.75 | 0.15 | diff --git a/results/netcoreapp2.0/LogContextEnrichmentBenchmark-report-github.md b/results/netcoreapp2.0/LogContextEnrichmentBenchmark-report-github.md deleted file mode 100644 index 381593159..000000000 --- a/results/netcoreapp2.0/LogContextEnrichmentBenchmark-report-github.md +++ /dev/null @@ -1,17 +0,0 @@ -``` ini - -BenchmarkDotNet=v0.10.6, OS=Mac OS X 10.12 -Processor=Intel Core i7-7567U CPU 3.50GHz (Kaby Lake), ProcessorCount=4 -Frequency=1000000000 Hz, Resolution=1.0000 ns, Timer=UNKNOWN -dotnet cli version=2.1.4 - [Host] : .NET Core 4.6.0.0, 64bit RyuJIT - DefaultJob : .NET Core 4.6.0.0, 64bit RyuJIT - - -``` - | Method | Mean | Error | StdDev | Scaled | ScaledSD | - |--------------------- |----------:|----------:|-----------:|-------:|---------:| - | Bare | 12.05 ns | 0.3210 ns | 0.5789 ns | 1.00 | 0.00 | - | PushProperty | 149.67 ns | 2.9527 ns | 3.2820 ns | 12.45 | 0.62 | - | PushPropertyNested | 296.44 ns | 6.7011 ns | 11.0101 ns | 24.65 | 1.43 | - | PushPropertyEnriched | 304.18 ns | 5.7287 ns | 8.3971 ns | 25.29 | 1.33 | diff --git a/results/netcoreapp2.0/MessageTemplateCacheBenchmark_Cached-report-github.md b/results/netcoreapp2.0/MessageTemplateCacheBenchmark_Cached-report-github.md deleted file mode 100644 index c60408213..000000000 --- a/results/netcoreapp2.0/MessageTemplateCacheBenchmark_Cached-report-github.md +++ /dev/null @@ -1,43 +0,0 @@ -``` ini - -BenchmarkDotNet=v0.10.6, OS=Mac OS X 10.12 -Processor=Intel Core i7-7567U CPU 3.50GHz (Kaby Lake), ProcessorCount=4 -Frequency=1000000000 Hz, Resolution=1.0000 ns, Timer=UNKNOWN -dotnet cli version=2.1.4 - [Host] : .NET Core 4.6.0.0, 64bit RyuJIT - DefaultJob : .NET Core 4.6.0.0, 64bit RyuJIT - - -``` - | Method | Items | MaxDegreeOfParallelism | Mean | Error | StdDev | Median | Scaled | ScaledSD | - |----------- |------ |----------------------- |------------:|-----------:|------------:|------------:|-------:|---------:| - | **Dictionary** | **10** | **-1** | **484.65 us** | **29.5203 us** | **86.1121 us** | **475.13 us** | **1.00** | **0.00** | - | Hashtable | 10 | -1 | 74.78 us | 1.5697 us | 2.8304 us | 73.99 us | 0.16 | 0.03 | - | Concurrent | 10 | -1 | 69.52 us | 0.6831 us | 0.5704 us | 69.62 us | 0.15 | 0.03 | - | **Dictionary** | **10** | **1** | **116.22 us** | **2.2490 us** | **2.4998 us** | **115.86 us** | **1.00** | **0.00** | - | Hashtable | 10 | 1 | 140.77 us | 2.8065 us | 4.1137 us | 140.40 us | 1.21 | 0.04 | - | Concurrent | 10 | 1 | 132.99 us | 2.2509 us | 1.9954 us | 132.61 us | 1.14 | 0.03 | - | **Dictionary** | **20** | **-1** | **593.71 us** | **30.5094 us** | **89.9578 us** | **602.83 us** | **1.00** | **0.00** | - | Hashtable | 20 | -1 | 136.36 us | 3.6865 us | 10.5773 us | 133.11 us | 0.24 | 0.04 | - | Concurrent | 20 | -1 | 127.68 us | 2.7541 us | 5.1729 us | 125.60 us | 0.22 | 0.03 | - | **Dictionary** | **20** | **1** | **247.53 us** | **4.9128 us** | **8.8589 us** | **247.69 us** | **1.00** | **0.00** | - | Hashtable | 20 | 1 | 269.34 us | 5.0332 us | 4.7081 us | 270.26 us | 1.09 | 0.04 | - | Concurrent | 20 | 1 | 265.41 us | 5.0592 us | 4.2247 us | 264.26 us | 1.07 | 0.04 | - | **Dictionary** | **50** | **-1** | **1,344.03 us** | **75.5937 us** | **219.3111 us** | **1,299.64 us** | **1.00** | **0.00** | - | Hashtable | 50 | -1 | 319.29 us | 6.2183 us | 10.7263 us | 316.55 us | 0.24 | 0.04 | - | Concurrent | 50 | -1 | 311.74 us | 6.3992 us | 16.7456 us | 305.20 us | 0.24 | 0.04 | - | **Dictionary** | **50** | **1** | **580.35 us** | **10.5809 us** | **9.3797 us** | **580.59 us** | **1.00** | **0.00** | - | Hashtable | 50 | 1 | 685.28 us | 16.2339 us | 23.2821 us | 682.71 us | 1.18 | 0.04 | - | Concurrent | 50 | 1 | 663.75 us | 14.2723 us | 16.9902 us | 664.83 us | 1.14 | 0.03 | - | **Dictionary** | **100** | **-1** | **2,766.91 us** | **70.1788 us** | **206.9237 us** | **2,776.40 us** | **1.00** | **0.00** | - | Hashtable | 100 | -1 | 634.39 us | 11.9496 us | 17.8855 us | 632.35 us | 0.23 | 0.02 | - | Concurrent | 100 | -1 | 607.86 us | 12.1245 us | 14.8900 us | 605.14 us | 0.22 | 0.02 | - | **Dictionary** | **100** | **1** | **1,145.86 us** | **21.7679 us** | **19.2966 us** | **1,151.96 us** | **1.00** | **0.00** | - | Hashtable | 100 | 1 | 1,384.02 us | 26.6146 us | 27.3312 us | 1,386.84 us | 1.21 | 0.03 | - | Concurrent | 100 | 1 | 1,374.88 us | 30.0217 us | 59.2599 us | 1,363.38 us | 1.20 | 0.05 | - | **Dictionary** | **1000** | **-1** | **2,722.48 us** | **70.6602 us** | **206.1192 us** | **2,724.74 us** | **1.00** | **0.00** | - | Hashtable | 1000 | -1 | 634.43 us | 12.5225 us | 19.4960 us | 642.28 us | 0.23 | 0.02 | - | Concurrent | 1000 | -1 | 611.38 us | 11.9573 us | 22.1637 us | 609.39 us | 0.23 | 0.02 | - | **Dictionary** | **1000** | **1** | **1,202.34 us** | **27.6262 us** | **32.8871 us** | **1,196.17 us** | **1.00** | **0.00** | - | Hashtable | 1000 | 1 | 1,408.56 us | 24.4617 us | 22.8815 us | 1,410.87 us | 1.17 | 0.04 | - | Concurrent | 1000 | 1 | 1,342.42 us | 19.1854 us | 17.9460 us | 1,338.93 us | 1.12 | 0.03 | diff --git a/results/netcoreapp2.0/MessageTemplateCacheBenchmark_Leaking-report-github.md b/results/netcoreapp2.0/MessageTemplateCacheBenchmark_Leaking-report-github.md deleted file mode 100644 index bf1ffdec5..000000000 --- a/results/netcoreapp2.0/MessageTemplateCacheBenchmark_Leaking-report-github.md +++ /dev/null @@ -1,37 +0,0 @@ -``` ini - -BenchmarkDotNet=v0.10.6, OS=Mac OS X 10.12 -Processor=Intel Core i7-7567U CPU 3.50GHz (Kaby Lake), ProcessorCount=4 -Frequency=1000000000 Hz, Resolution=1.0000 ns, Timer=UNKNOWN -dotnet cli version=2.1.4 - [Host] : .NET Core 4.6.0.0, 64bit RyuJIT - DefaultJob : .NET Core 4.6.0.0, 64bit RyuJIT - - -``` - | Method | Items | OverflowCount | MaxDegreeOfParallelism | Mean | Error | StdDev | Median | Scaled | ScaledSD | - |----------- |------ |-------------- |----------------------- |-----------:|-----------:|-----------:|-----------:|-------:|---------:| - | **Dictionary** | **10000** | **1** | **-1** | **3.809 ms** | **0.1689 ms** | **0.4900 ms** | **3.695 ms** | **1.00** | **0.00** | - | Hashtable | 10000 | 1 | -1 | 3.401 ms | 0.0587 ms | 0.0763 ms | 3.386 ms | 0.91 | 0.11 | - | Concurrent | 10000 | 1 | -1 | 141.271 ms | 14.7981 ms | 43.6325 ms | 141.945 ms | 37.67 | 12.51 | - | **Dictionary** | **10000** | **1** | **1** | **1.995 ms** | **0.0396 ms** | **0.0617 ms** | **1.982 ms** | **1.00** | **0.00** | - | Hashtable | 10000 | 1 | 1 | 2.581 ms | 0.0429 ms | 0.0401 ms | 2.575 ms | 1.30 | 0.04 | - | Concurrent | 10000 | 1 | 1 | 193.445 ms | 2.1087 ms | 1.9725 ms | 193.561 ms | 97.07 | 3.08 | - | **Dictionary** | **10000** | **10** | **-1** | **3.300 ms** | **0.0726 ms** | **0.2119 ms** | **3.281 ms** | **1.00** | **0.00** | - | Hashtable | 10000 | 10 | -1 | 3.252 ms | 0.0646 ms | 0.1498 ms | 3.232 ms | 0.99 | 0.08 | - | Concurrent | 10000 | 10 | -1 | 81.583 ms | 3.0187 ms | 8.9007 ms | 79.069 ms | 24.82 | 3.12 | - | **Dictionary** | **10000** | **10** | **1** | **1.979 ms** | **0.0390 ms** | **0.0449 ms** | **1.970 ms** | **1.00** | **0.00** | - | Hashtable | 10000 | 10 | 1 | 2.576 ms | 0.0398 ms | 0.0352 ms | 2.563 ms | 1.30 | 0.03 | - | Concurrent | 10000 | 10 | 1 | 200.065 ms | 4.9247 ms | 5.8626 ms | 200.199 ms | 101.16 | 3.64 | - | **Dictionary** | **10000** | **100** | **-1** | **4.076 ms** | **0.0813 ms** | **0.2292 ms** | **4.066 ms** | **1.00** | **0.00** | - | Hashtable | 10000 | 100 | -1 | 3.660 ms | 0.0719 ms | 0.1008 ms | 3.653 ms | 0.90 | 0.06 | - | Concurrent | 10000 | 100 | -1 | 167.547 ms | 20.0876 ms | 58.2777 ms | 175.712 ms | 41.23 | 14.48 | - | **Dictionary** | **10000** | **100** | **1** | **2.061 ms** | **0.0354 ms** | **0.0331 ms** | **2.054 ms** | **1.00** | **0.00** | - | Hashtable | 10000 | 100 | 1 | 2.685 ms | 0.0331 ms | 0.0310 ms | 2.685 ms | 1.30 | 0.02 | - | Concurrent | 10000 | 100 | 1 | 198.448 ms | 2.5433 ms | 2.3790 ms | 198.288 ms | 96.31 | 1.86 | - | **Dictionary** | **10000** | **1000** | **-1** | **3.923 ms** | **0.1650 ms** | **0.4788 ms** | **3.865 ms** | **1.00** | **0.00** | - | Hashtable | 10000 | 1000 | -1 | 3.870 ms | 0.0766 ms | 0.1907 ms | 3.862 ms | 1.00 | 0.13 | - | Concurrent | 10000 | 1000 | -1 | 207.440 ms | 23.7700 ms | 70.0864 ms | 182.505 ms | 53.66 | 19.30 | - | **Dictionary** | **10000** | **1000** | **1** | **2.150 ms** | **0.0278 ms** | **0.0246 ms** | **2.154 ms** | **1.00** | **0.00** | - | Hashtable | 10000 | 1000 | 1 | 2.806 ms | 0.0398 ms | 0.0373 ms | 2.795 ms | 1.31 | 0.02 | - | Concurrent | 10000 | 1000 | 1 | 201.843 ms | 3.2293 ms | 2.8627 ms | 201.881 ms | 93.91 | 1.66 | diff --git a/results/netcoreapp2.0/MessageTemplateParsingBenchmark-report-github.md b/results/netcoreapp2.0/MessageTemplateParsingBenchmark-report-github.md deleted file mode 100644 index e6d28084a..000000000 --- a/results/netcoreapp2.0/MessageTemplateParsingBenchmark-report-github.md +++ /dev/null @@ -1,15 +0,0 @@ -``` ini - -BenchmarkDotNet=v0.10.6, OS=Mac OS X 10.12 -Processor=Intel Core i7-7567U CPU 3.50GHz (Kaby Lake), ProcessorCount=4 -Frequency=1000000000 Hz, Resolution=1.0000 ns, Timer=UNKNOWN -dotnet cli version=2.1.4 - [Host] : .NET Core 4.6.0.0, 64bit RyuJIT - DefaultJob : .NET Core 4.6.0.0, 64bit RyuJIT - - -``` - | Method | Mean | Error | StdDev | Scaled | ScaledSD | Gen 0 | Allocated | - |----------------------------- |-----------:|----------:|----------:|-------:|---------:|-------:|----------:| - | EmptyTemplate | 371.0 ns | 7.570 ns | 14.03 ns | 1.00 | 0.00 | 0.1259 | 264 B | - | DefaultConsoleOutputTemplate | 2,912.1 ns | 66.661 ns | 190.19 ns | 7.86 | 0.58 | 1.0948 | 2296 B | diff --git a/results/netcoreapp2.0/MessageTemplateRenderingBenchmark-report-github.md b/results/netcoreapp2.0/MessageTemplateRenderingBenchmark-report-github.md deleted file mode 100644 index 55bc3041a..000000000 --- a/results/netcoreapp2.0/MessageTemplateRenderingBenchmark-report-github.md +++ /dev/null @@ -1,15 +0,0 @@ -``` ini - -BenchmarkDotNet=v0.10.6, OS=Mac OS X 10.12 -Processor=Intel Core i7-7567U CPU 3.50GHz (Kaby Lake), ProcessorCount=4 -Frequency=1000000000 Hz, Resolution=1.0000 ns, Timer=UNKNOWN -dotnet cli version=2.1.4 - [Host] : .NET Core 4.6.0.0, 64bit RyuJIT - DefaultJob : .NET Core 4.6.0.0, 64bit RyuJIT - - -``` - | Method | Mean | Error | StdDev | Gen 0 | Allocated | - |----------------------------- |-----------:|----------:|-----------:|-------:|----------:| - | TemplateWithNoProperties | 5.067 ns | 0.1194 ns | 0.1058 ns | - | 0 B | - | TemplateWithVariedProperties | 423.457 ns | 8.8139 ns | 12.3559 ns | 0.0453 | 96 B | diff --git a/results/netcoreapp2.0/NestedLoggerCreationBenchmark-report-github.md b/results/netcoreapp2.0/NestedLoggerCreationBenchmark-report-github.md deleted file mode 100644 index 19223de66..000000000 --- a/results/netcoreapp2.0/NestedLoggerCreationBenchmark-report-github.md +++ /dev/null @@ -1,15 +0,0 @@ -``` ini - -BenchmarkDotNet=v0.10.6, OS=Mac OS X 10.12 -Processor=Intel Core i7-7567U CPU 3.50GHz (Kaby Lake), ProcessorCount=4 -Frequency=1000000000 Hz, Resolution=1.0000 ns, Timer=UNKNOWN -dotnet cli version=2.1.4 - [Host] : .NET Core 4.6.0.0, 64bit RyuJIT - DefaultJob : .NET Core 4.6.0.0, 64bit RyuJIT - - -``` - | Method | Mean | Error | StdDev | - |----------------- |---------:|---------:|---------:| - | ForContextString | 104.5 ns | 2.126 ns | 4.884 ns | - | ForContextType | 173.8 ns | 3.425 ns | 5.021 ns | diff --git a/results/netcoreapp2.0/NestedLoggerLatencyBenchmark-report-github.md b/results/netcoreapp2.0/NestedLoggerLatencyBenchmark-report-github.md deleted file mode 100644 index b722d8728..000000000 --- a/results/netcoreapp2.0/NestedLoggerLatencyBenchmark-report-github.md +++ /dev/null @@ -1,15 +0,0 @@ -``` ini - -BenchmarkDotNet=v0.10.6, OS=Mac OS X 10.12 -Processor=Intel Core i7-7567U CPU 3.50GHz (Kaby Lake), ProcessorCount=4 -Frequency=1000000000 Hz, Resolution=1.0000 ns, Timer=UNKNOWN -dotnet cli version=2.1.4 - [Host] : .NET Core 4.6.0.0, 64bit RyuJIT - DefaultJob : .NET Core 4.6.0.0, 64bit RyuJIT - - -``` - | Method | Mean | Error | StdDev | Scaled | ScaledSD | - |------------- |---------:|----------:|----------:|-------:|---------:| - | RootLogger | 11.78 ns | 0.1157 ns | 0.1082 ns | 1.00 | 0.00 | - | NestedLogger | 41.70 ns | 0.1993 ns | 0.1556 ns | 3.54 | 0.03 | diff --git a/results/netcoreapp2.0/OutputTemplateRenderingBenchmark-report-github.md b/results/netcoreapp2.0/OutputTemplateRenderingBenchmark-report-github.md deleted file mode 100644 index bba42387e..000000000 --- a/results/netcoreapp2.0/OutputTemplateRenderingBenchmark-report-github.md +++ /dev/null @@ -1,14 +0,0 @@ -``` ini - -BenchmarkDotNet=v0.10.6, OS=Mac OS X 10.12 -Processor=Intel Core i7-7567U CPU 3.50GHz (Kaby Lake), ProcessorCount=4 -Frequency=1000000000 Hz, Resolution=1.0000 ns, Timer=UNKNOWN -dotnet cli version=2.1.4 - [Host] : .NET Core 4.6.0.0, 64bit RyuJIT - DefaultJob : .NET Core 4.6.0.0, 64bit RyuJIT - - -``` - | Method | Mean | Error | StdDev | Gen 0 | Allocated | - |--------------- |---------:|----------:|----------:|-------:|----------:| - | FormatToOutput | 1.386 us | 0.0237 us | 0.0222 us | 0.2327 | 488 B | diff --git a/results/netcoreapp2.0/PipelineBenchmark-report-github.md b/results/netcoreapp2.0/PipelineBenchmark-report-github.md deleted file mode 100644 index e945e1b09..000000000 --- a/results/netcoreapp2.0/PipelineBenchmark-report-github.md +++ /dev/null @@ -1,14 +0,0 @@ -``` ini - -BenchmarkDotNet=v0.10.6, OS=Mac OS X 10.12 -Processor=Intel Core i7-7567U CPU 3.50GHz (Kaby Lake), ProcessorCount=4 -Frequency=1000000000 Hz, Resolution=1.0000 ns, Timer=UNKNOWN -dotnet cli version=2.1.4 - [Host] : .NET Core 4.6.0.0, 64bit RyuJIT - DefaultJob : .NET Core 4.6.0.0, 64bit RyuJIT - - -``` - | Method | Mean | Error | StdDev | Gen 0 | Allocated | - |------------- |---------:|---------:|---------:|-------:|----------:| - | EmitLogEvent | 837.9 ns | 16.17 ns | 15.88 ns | 0.2060 | 432 B | diff --git a/results/netcoreapp3.1/SourceContextMatchBenchmark-report-github.md b/results/netcoreapp3.1/SourceContextMatchBenchmark-report-github.md deleted file mode 100644 index 35841fbc6..000000000 --- a/results/netcoreapp3.1/SourceContextMatchBenchmark-report-github.md +++ /dev/null @@ -1,50 +0,0 @@ -# Benchmark results - -## Linux - -``` ini - -BenchmarkDotNet=v0.12.0, OS=debian 11 -Intel Core i7-3840QM CPU 2.80GHz (Ivy Bridge), 1 CPU, 4 logical and 2 physical cores -.NET Core SDK=3.1.201 - [Host] : .NET Core 3.1.3 (CoreCLR 4.700.20.11803, CoreFX 4.700.20.12001), X64 RyuJIT - Job-CSERBI : .NET Core 2.1.16 (CoreCLR 4.6.28516.03, CoreFX 4.6.28516.10), X64 RyuJIT - Job-GDNCBZ : .NET Core 3.1.3 (CoreCLR 4.700.20.11803, CoreFX 4.700.20.12001), X64 RyuJIT - - -``` -| Method | Runtime | Mean | Error | StdDev | Ratio | -|----------------------------------- |-------------- |-----------:|---------:|---------:|------:| -| Filter_MatchingFromSource | .NET Core 2.1 | 5,799.5 ns | 51.17 ns | 45.36 ns | 1.00 | -| Filter_MatchingFromSource | .NET Core 3.1 | 3,564.5 ns | 37.43 ns | 35.01 ns | 0.61 | -| | | | | | | -| Logger_ForContext | .NET Core 2.1 | 2,519.0 ns | 15.37 ns | 13.62 ns | 1.00 | -| Logger_ForContext | .NET Core 3.1 | 961.8 ns | 4.67 ns | 4.36 ns | 0.38 | -| | | | | | | -| LevelOverrideMap_GetEffectiveLevel | .NET Core 2.1 | 1,745.7 ns | 11.95 ns | 10.60 ns | 1.00 | -| LevelOverrideMap_GetEffectiveLevel | .NET Core 3.1 | 193.8 ns | 2.35 ns | 2.20 ns | 0.11 | - -## Windows - -``` ini - -BenchmarkDotNet=v0.12.0, OS=Windows 10.0.19041 -Intel Core i7-3840QM CPU 2.80GHz (Ivy Bridge), 1 CPU, 8 logical and 4 physical cores -.NET Core SDK=3.1.300 - [Host] : .NET Core 3.1.4 (CoreCLR 4.700.20.20201, CoreFX 4.700.20.22101), X64 RyuJIT - Job-KEWXME : .NET Core 2.1.16 (CoreCLR 4.6.28516.03, CoreFX 4.6.28516.10), X64 RyuJIT - Job-KKEVOV : .NET Core 3.1.4 (CoreCLR 4.700.20.20201, CoreFX 4.700.20.22101), X64 RyuJIT - - -``` -| Method | Runtime | Mean | Error | StdDev | Ratio | -|----------------------------------- |-------------- |-----------:|----------:|----------:|------:| -| Filter_MatchingFromSource | .NET Core 2.1 | 8,088.7 ns | 120.48 ns | 112.70 ns | 1.00 | -| Filter_MatchingFromSource | .NET Core 3.1 | 3,369.0 ns | 71.49 ns | 73.42 ns | 0.42 | -| | | | | | | -| Logger_ForContext | .NET Core 2.1 | 6,322.1 ns | 98.18 ns | 91.84 ns | 1.00 | -| Logger_ForContext | .NET Core 3.1 | 785.6 ns | 9.05 ns | 8.47 ns | 0.12 | -| | | | | | | -| LevelOverrideMap_GetEffectiveLevel | .NET Core 2.1 | 5,619.1 ns | 20.98 ns | 18.60 ns | 1.00 | -| LevelOverrideMap_GetEffectiveLevel | .NET Core 3.1 | 185.4 ns | 1.63 ns | 1.44 ns | 0.03 | - diff --git a/test/Serilog.PerformanceTests/AllocationsBenchmark.cs b/test/Serilog.PerformanceTests/AllocationsBenchmark.cs deleted file mode 100644 index 59bf453c6..000000000 --- a/test/Serilog.PerformanceTests/AllocationsBenchmark.cs +++ /dev/null @@ -1,98 +0,0 @@ -using Serilog.Core.Enrichers; - -namespace Serilog.PerformanceTests; - -[MemoryDiagnoser] -public class AllocationsBenchmark -{ - readonly ILogger _logger; - readonly ILogger _enrichedLogger; - readonly LogEvent _emptyEvent; - readonly object _dictionaryValue; - readonly object _anonymousObject; - readonly object _sequence; - - public AllocationsBenchmark() - { - _logger = new LoggerConfiguration().CreateLogger(); - - _enrichedLogger = _logger.ForContext(new PropertyEnricher("Prop", "Value")); - - _emptyEvent = new( - DateTimeOffset.Now, - LogEventLevel.Information, - null, - new(Enumerable.Empty()), - Enumerable.Empty()); - - _anonymousObject = new - { - Level11 = "Val1", - Level12 = new - { - Level21 = (int?)42, - Level22 = new - { - Level31 = System.Reflection.BindingFlags.FlattenHierarchy, - Level32 = new - { - X = 3, - Y = "4", - Z = (short?)5 - } - } - } - }; - - _dictionaryValue = new Dictionary { - { "Level11", "Val1" }, - { "Level12", new Dictionary { - { "Level21", (int?)42 }, - { "Level22", new Dictionary { - { "Level31", System.Reflection.BindingFlags.FlattenHierarchy }, - { "Level32", new { X = 3, Y = "4", Z = (short?)5 } } - } - } - } - } - }; - - _sequence = new List { "1", 2, (int?)3, "4", (short)5 }; - } - - [Benchmark(Baseline = true)] - public void LogEmpty() - { - _logger.Write(_emptyEvent); - } - - [Benchmark] - public void LogEmptyWithEnricher() - { - _enrichedLogger.Write(_emptyEvent); - } - - [Benchmark] - public void LogScalar() - { - _logger.Information("Template: {ScalarValue}", "42"); - } - - [Benchmark] - public void LogDictionary() - { - _logger.Information("Template: {DictionaryValue}", _dictionaryValue); - } - - [Benchmark] - public void LogSequence() - { - _logger.Information("Template: {SequenceValue}", _sequence); - } - - [Benchmark] - public void LogAnonymous() - { - _logger.Information("Template: {@AnonymousObject}.", _anonymousObject); - } -} diff --git a/test/Serilog.PerformanceTests/BindingBenchmark.cs b/test/Serilog.PerformanceTests/BindingBenchmark.cs deleted file mode 100644 index e4de9bacd..000000000 --- a/test/Serilog.PerformanceTests/BindingBenchmark.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2013-2016 Serilog Contributors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -namespace Serilog.PerformanceTests; - -/// -/// Tests the cost of writing through the logging pipeline. -/// -[MemoryDiagnoser] -public class BindingBenchmark -{ - const string - MT0 = "Zero", - MT1 = "Zero{A}one", - MT5 = "Zero{A}one{B}two{C}three{D}four{E}five"; - - ILogger _log = null!; - object[] _zero= null!, _one= null!, _five = null!; - - [GlobalSetup] - public void Setup() - { - _log = new LoggerConfiguration() - .WriteTo.Sink(new NullSink()) - .CreateLogger(); - - _zero = new object[0]; - _one = new object[] { 1 }; - _five = new object[] { 1, 2, 3, 4, 5 }; - } - - // The benchmarks run p.Count() to force enumeration; this will be representative of how the API - // is consumed (there's not much point benchmarking time to return a lazy enumerator). - - [Benchmark(Baseline = true)] - public (MessageTemplate, int) BindZero() - { - _log.BindMessageTemplate(MT0, _zero, out var mt, out var p); - return (mt, p!.Count())!; - } - - [Benchmark] - public (MessageTemplate, int) BindOne() - { - _log.BindMessageTemplate(MT1, _one, out var mt, out var p); - return (mt, p!.Count())!; - } - - [Benchmark] - public (MessageTemplate, int) BindFive() - { - _log.BindMessageTemplate(MT5, _five, out var mt, out var p); - return (mt, p!.Count())!; - } -} diff --git a/test/Serilog.PerformanceTests/GlobalUsings.cs b/test/Serilog.PerformanceTests/GlobalUsings.cs deleted file mode 100644 index ceb640a66..000000000 --- a/test/Serilog.PerformanceTests/GlobalUsings.cs +++ /dev/null @@ -1,15 +0,0 @@ -global using System.Collections.Concurrent; -global using System.Globalization; -global using System.Text; -global using BenchmarkDotNet.Attributes; -global using BenchmarkDotNet.Jobs; -global using BenchmarkDotNet.Running; -global using Serilog.Context; -global using Serilog.Core; -global using Serilog.Core.Pipeline; -global using Serilog.Events; -global using Serilog.Filters; -global using Serilog.Formatting.Display; -global using Serilog.Parsing; -global using Serilog.PerformanceTests.Support; -global using Xunit; diff --git a/test/Serilog.PerformanceTests/Harness.cs b/test/Serilog.PerformanceTests/Harness.cs deleted file mode 100644 index 1722ff619..000000000 --- a/test/Serilog.PerformanceTests/Harness.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2013-2020 Serilog Contributors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -namespace Serilog.PerformanceTests; - -/// -/// Wrappers that make it easy to run benchmark suites through the dotnet test runner. -/// -/// -/// dotnet test -c Release -f netcoreapp3.1 --filter "FullyQualifiedName=Serilog.PerformanceTests.Harness.Allocations" -/// -public class Harness -{ - [Fact] - public void SourceContextMatch() - { - BenchmarkRunner.Run(); - } - - [Fact] - public void Allocations() - { - BenchmarkRunner.Run(); - } - - [Fact] - public void MessageTemplateCache() - { - BenchmarkRunner.Run(); - BenchmarkRunner.Run(); - } - - [Fact] - public void LogContextEnrichment() - { - BenchmarkRunner.Run(); - } - - [Fact] - public void MessageTemplateParsing() - { - BenchmarkRunner.Run(); - } - - [Fact] - public void LevelControl() - { - BenchmarkRunner.Run(); - } - - [Fact] - public void NestedLoggerCreation() - { - BenchmarkRunner.Run(); - } - - [Fact] - public void NestedLoggerLatency() - { - BenchmarkRunner.Run(); - } - - [Fact] - public void Pipeline() - { - BenchmarkRunner.Run(); - } - - [Fact] - public void OutputTemplateRendering() - { - BenchmarkRunner.Run(); - } - - [Fact] - public void MessageTemplateRendering() - { - BenchmarkRunner.Run(); - } - - [Fact] - public void Binding() - { - BenchmarkRunner.Run(); - } -} diff --git a/test/Serilog.PerformanceTests/LevelControlBenchmark.cs b/test/Serilog.PerformanceTests/LevelControlBenchmark.cs deleted file mode 100644 index cbe7efa4d..000000000 --- a/test/Serilog.PerformanceTests/LevelControlBenchmark.cs +++ /dev/null @@ -1,55 +0,0 @@ -namespace Serilog.PerformanceTests; - -/// -/// Tests the overhead of determining the active logging level. -/// -public class LevelControlBenchmark -{ - ILogger _off = null!, _levelSwitchOff = null!, _minLevel = null!, _levelSwitch = null!; - readonly LogEvent _event = Some.InformationEvent(); - - [GlobalSetup] - public void Setup() - { - _off = new LoggerConfiguration() - .MinimumLevel.Fatal() - .WriteTo.Sink(new NullSink()) - .CreateLogger(); - _levelSwitchOff = new LoggerConfiguration() - .MinimumLevel.ControlledBy(new LoggingLevelSwitch(LogEventLevel.Fatal)) - .WriteTo.Sink(new NullSink()) - .CreateLogger(); - _minLevel = new LoggerConfiguration() - .MinimumLevel.Information() - .WriteTo.Sink(new NullSink()) - .CreateLogger(); - _levelSwitch = new LoggerConfiguration() - .MinimumLevel.ControlledBy(new LoggingLevelSwitch(LogEventLevel.Information)) - .WriteTo.Sink(new NullSink()) - .CreateLogger(); - } - - [Benchmark(Baseline = true)] - public void Off() - { - _off.Write(_event); - } - - [Benchmark] - public void LevelSwitchOff() - { - _levelSwitchOff.Write(_event); - } - - [Benchmark] - public void MinimumLevelOn() - { - _minLevel.Write(_event); - } - - [Benchmark] - public void LevelSwitchOn() - { - _levelSwitch.Write(_event); - } -} diff --git a/test/Serilog.PerformanceTests/LogContextEnrichmentBenchmark.cs b/test/Serilog.PerformanceTests/LogContextEnrichmentBenchmark.cs deleted file mode 100644 index 62bca0a6d..000000000 --- a/test/Serilog.PerformanceTests/LogContextEnrichmentBenchmark.cs +++ /dev/null @@ -1,52 +0,0 @@ -namespace Serilog.PerformanceTests; - -public class LogContextEnrichmentBenchmark -{ - ILogger _bare = null!, _enriched = null!; - readonly LogEvent _event = Some.InformationEvent(); - - [GlobalSetup] - public void Setup() - { - _bare = new LoggerConfiguration() - .WriteTo.Sink(new NullSink()) - .CreateLogger(); - - _enriched = new LoggerConfiguration() - .WriteTo.Sink(new NullSink()) - .Enrich.FromLogContext() - .CreateLogger(); - } - - [Benchmark(Baseline = true)] - public void Bare() - { - _bare.Write(_event); - } - - [Benchmark] - public void PushProperty() - { - using (LogContext.PushProperty("A", "B")) - { - } - } - - [Benchmark] - public void PushPropertyNested() - { - using (LogContext.PushProperty("A", "B")) - using (LogContext.PushProperty("C", "D")) - { - } - } - - [Benchmark] - public void PushPropertyEnriched() - { - using (LogContext.PushProperty("A", "B")) - { - _enriched.Write(_event); - } - } -} diff --git a/test/Serilog.PerformanceTests/MessageTemplateCacheBenchmark/MessageTemplateCacheBenchmark_Cached.cs b/test/Serilog.PerformanceTests/MessageTemplateCacheBenchmark/MessageTemplateCacheBenchmark_Cached.cs deleted file mode 100644 index 03690f564..000000000 --- a/test/Serilog.PerformanceTests/MessageTemplateCacheBenchmark/MessageTemplateCacheBenchmark_Cached.cs +++ /dev/null @@ -1,66 +0,0 @@ -namespace Serilog.PerformanceTests; - -public class MessageTemplateCacheBenchmark_Cached -{ - const string DefaultOutputTemplate = "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level}] {Message}{NewLine}{Exception}"; - - List _templateList = null!; - - ConcurrentDictionaryMessageTemplateCache _concurrentCache = null!; - DictionaryMessageTemplateCache _dictionaryCache = null!; - MessageTemplateCache _hashtableCache = null!; - - [Params(10, 20, 50, 100, 1000)] - public int Items { get; set; } - - [Params(1, -1)] - public int MaxDegreeOfParallelism { get; set; } - - [GlobalSetup] - public void Setup() - { - _templateList = Enumerable.Range(0, Items).Select(_ => $"{DefaultOutputTemplate}_{Guid.NewGuid()}").ToList(); - - _concurrentCache = new(NoOpMessageTemplateParser.Instance); - _dictionaryCache = new(NoOpMessageTemplateParser.Instance); - _hashtableCache = new(NoOpMessageTemplateParser.Instance); - - foreach (var t in _templateList) - { - _concurrentCache.Parse(t); - _dictionaryCache.Parse(t); - _hashtableCache.Parse(t); - } - } - - [Benchmark(Baseline = true)] - public void Dictionary() - { - Run(() => _dictionaryCache); - } - - [Benchmark] - public void Hashtable() - { - Run(() => _hashtableCache); - } - - [Benchmark] - public void Concurrent() - { - Run(() => _concurrentCache); - } - - void Run(Func cacheFactory) - where T : IMessageTemplateParser - { - var cache = cacheFactory(); - var iterations = Math.Min(10000, Items * 100); - - Parallel.For( - 0, - iterations, - new() { MaxDegreeOfParallelism = MaxDegreeOfParallelism }, - idx => cache.Parse(_templateList[idx % Items])); - } -} diff --git a/test/Serilog.PerformanceTests/MessageTemplateCacheBenchmark/MessageTemplateCacheBenchmark_Leaking.cs b/test/Serilog.PerformanceTests/MessageTemplateCacheBenchmark/MessageTemplateCacheBenchmark_Leaking.cs deleted file mode 100644 index 1cf6729a9..000000000 --- a/test/Serilog.PerformanceTests/MessageTemplateCacheBenchmark/MessageTemplateCacheBenchmark_Leaking.cs +++ /dev/null @@ -1,55 +0,0 @@ -namespace Serilog.PerformanceTests; - -public class MessageTemplateCacheBenchmark_Leaking -{ - const string DefaultOutputTemplate = "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level}] {Message}{NewLine}{Exception}"; - const int MaxCacheItems = 1000; - - List _templateList = null!; - - [Params(10000)] - public int Items { get; set; } - - [Params(1, 10, 100, 1000)] - public int OverflowCount { get; set; } - - [Params(1, -1)] - public int MaxDegreeOfParallelism { get; set; } - - [GlobalSetup] - public void Setup() - { - _templateList = Enumerable.Range(0, Items).Select(_ => $"{DefaultOutputTemplate}_{Guid.NewGuid()}").ToList(); - } - - [Benchmark(Baseline = true)] - public void Dictionary() - { - Run(() => new DictionaryMessageTemplateCache(NoOpMessageTemplateParser.Instance)); - } - - [Benchmark] - public void Hashtable() - { - Run(() => new MessageTemplateCache(NoOpMessageTemplateParser.Instance)); - } - - [Benchmark] - public void Concurrent() - { - Run(() => new ConcurrentDictionaryMessageTemplateCache(NoOpMessageTemplateParser.Instance)); - } - - void Run(Func cacheFactory) - where T : IMessageTemplateParser - { - var cache = cacheFactory(); - var total = MaxCacheItems + OverflowCount; - - Parallel.For( - 0, - _templateList.Count, - new ParallelOptions { MaxDegreeOfParallelism = MaxDegreeOfParallelism }, - idx => cache.Parse(_templateList[idx % total])); - } -} diff --git a/test/Serilog.PerformanceTests/MessageTemplateParsingBenchmark.cs b/test/Serilog.PerformanceTests/MessageTemplateParsingBenchmark.cs deleted file mode 100644 index fc1b495b3..000000000 --- a/test/Serilog.PerformanceTests/MessageTemplateParsingBenchmark.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace Serilog.PerformanceTests; - -/// -/// Tests the cost of parsing various message templates. -/// -[MemoryDiagnoser] -public class MessageTemplateParsingBenchmark -{ - MessageTemplateParser _parser = null!; - const string _DefaultConsoleOutputTemplate = "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level}] {Message}{NewLine}{Exception}"; - - [GlobalSetup] - public void Setup() - { - _parser = new MessageTemplateParser(); - } - - [Benchmark(Baseline = true)] - public void EmptyTemplate() - { - _parser.Parse(""); - } - - [Benchmark] - public void DefaultConsoleOutputTemplate() - { - _parser.Parse(_DefaultConsoleOutputTemplate); - } -} diff --git a/test/Serilog.PerformanceTests/MessageTemplateRenderingBenchmark.cs b/test/Serilog.PerformanceTests/MessageTemplateRenderingBenchmark.cs deleted file mode 100644 index 126fe247c..000000000 --- a/test/Serilog.PerformanceTests/MessageTemplateRenderingBenchmark.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace Serilog.PerformanceTests; - -/// -/// Determines the cost of rendering a message template. -/// -[MemoryDiagnoser] -public class MessageTemplateRenderingBenchmark -{ - static readonly LogEvent NoProperties = - Some.InformationEvent("This template has no properties"); - - static readonly LogEvent VariedProperties = - Some.InformationEvent("Processed {@Position} for {Task} in {Elapsed:000} ms", - new { Latitude = 25, Longitude = 134 }, "Benchmark", 34); - - readonly NullTextWriter _output = new(); - - [Benchmark] - public void TemplateWithNoProperties() - { - NoProperties.MessageTemplate.Render(NoProperties.Properties, _output); - } - - [Benchmark] - public void TemplateWithVariedProperties() - { - VariedProperties.MessageTemplate.Render(VariedProperties.Properties, _output); - } -} diff --git a/test/Serilog.PerformanceTests/NestedLoggerCreationBenchmark.cs b/test/Serilog.PerformanceTests/NestedLoggerCreationBenchmark.cs deleted file mode 100644 index 19934db9c..000000000 --- a/test/Serilog.PerformanceTests/NestedLoggerCreationBenchmark.cs +++ /dev/null @@ -1,36 +0,0 @@ -namespace Serilog.PerformanceTests; - -/// -/// Tests the cost creating a nested logger. -/// -[MemoryDiagnoser] -public class NestedLoggerCreationBenchmark -{ - ILogger log = null!; - - [GlobalSetup] - public void Setup() - { - log = new LoggerConfiguration() - .WriteTo.Sink(new NullSink()) - .CreateLogger(); - } - - [Benchmark] - public void ForContextInt() - { - log.ForContext("Number", 1); - } - - [Benchmark] - public void ForContextString() - { - log.ForContext("SourceContext", "Serilog.PerformanceTests"); - } - - [Benchmark] - public void ForContextType() - { - log.ForContext(); - } -} diff --git a/test/Serilog.PerformanceTests/NestedLoggerLatencyBenchmark.cs b/test/Serilog.PerformanceTests/NestedLoggerLatencyBenchmark.cs deleted file mode 100644 index 792da5703..000000000 --- a/test/Serilog.PerformanceTests/NestedLoggerLatencyBenchmark.cs +++ /dev/null @@ -1,32 +0,0 @@ -namespace Serilog.PerformanceTests; - -/// -/// Tests the overhead of writing through a nested logger. -/// -public class NestedLoggerLatencyBenchmark -{ - ILogger _log = null!, _nested = null!; - readonly LogEvent _event = Some.InformationEvent(); - - [GlobalSetup] - public void Setup() - { - _log = new LoggerConfiguration() - .WriteTo.Sink(new NullSink()) - .CreateLogger(); - - _nested = _log.ForContext(); - } - - [Benchmark(Baseline = true)] - public void RootLogger() - { - _log.Write(_event); - } - - [Benchmark] - public void NestedLogger() - { - _nested.Write(_event); - } -} diff --git a/test/Serilog.PerformanceTests/OutputTemplateRenderingBenchmark.cs b/test/Serilog.PerformanceTests/OutputTemplateRenderingBenchmark.cs deleted file mode 100644 index e9b602fa6..000000000 --- a/test/Serilog.PerformanceTests/OutputTemplateRenderingBenchmark.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Serilog.PerformanceTests; - -/// -/// Determines the cost of rendering an event out to one of the typical text targets, -/// like the console or a text file. -/// -[MemoryDiagnoser] -public class OutputTemplateRenderingBenchmark -{ - const string DefaultFileOutputTemplate = "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] {Message}{NewLine}{Exception}"; - static readonly LogEvent HelloWorldEvent = Some.InformationEvent("Hello, {Name}", "World"); - static readonly MessageTemplateTextFormatter Formatter = new(DefaultFileOutputTemplate, CultureInfo.InvariantCulture); - - readonly NullTextWriter _output = new(); - - [Benchmark] - public void FormatToOutput() - { - Formatter.Format(HelloWorldEvent, _output); - } -} diff --git a/test/Serilog.PerformanceTests/PipelineBenchmark.cs b/test/Serilog.PerformanceTests/PipelineBenchmark.cs deleted file mode 100644 index 2509a0960..000000000 --- a/test/Serilog.PerformanceTests/PipelineBenchmark.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2013-2016 Serilog Contributors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -namespace Serilog.PerformanceTests; - -/// -/// Tests the cost of writing through the logging pipeline. -/// -[MemoryDiagnoser] -public class PipelineBenchmark -{ - ILogger _log = null!; - Exception _exception = null!; - - [GlobalSetup] - public void Setup() - { - _exception = new Exception("An Error"); - _log = new LoggerConfiguration() - .WriteTo.Sink(new NullSink()) - .CreateLogger(); - - // Ensure template is cached - _log.Information(_exception, "Hello, {Name}!", "World"); - } - - [Benchmark] - public void EmitLogEvent() - { - _log.Information(_exception, "Hello, {Name}!", "World"); - } -} diff --git a/test/Serilog.PerformanceTests/Serilog.PerformanceTests.csproj b/test/Serilog.PerformanceTests/Serilog.PerformanceTests.csproj deleted file mode 100644 index 43ddd6aae..000000000 --- a/test/Serilog.PerformanceTests/Serilog.PerformanceTests.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - net6.0 - - - - - - - - - - - - - - - - - - diff --git a/test/Serilog.PerformanceTests/SourceContextMatchBenchmark.cs b/test/Serilog.PerformanceTests/SourceContextMatchBenchmark.cs deleted file mode 100644 index a26e10968..000000000 --- a/test/Serilog.PerformanceTests/SourceContextMatchBenchmark.cs +++ /dev/null @@ -1,84 +0,0 @@ -namespace Serilog.PerformanceTests; - -[SimpleJob(RuntimeMoniker.NetCoreApp21, baseline: true)] -[SimpleJob(RuntimeMoniker.NetCoreApp31)] -public class SourceContextMatchBenchmark -{ - readonly LevelOverrideMap _levelOverrideMap; - readonly Logger _loggerWithOverrides; - readonly List _loggersWithFilters = new(); - readonly LogEvent _event = Some.InformationEvent(); - readonly string[] _contexts; - - public SourceContextMatchBenchmark() - { - _contexts = new[] - { - "Serilog", - "MyApp", - "MyAppSomething", - "MyOtherApp", - "MyApp.Something", - "MyApp.Api.Models.Person", - "MyApp.Api.Controllers.AboutController", - "MyApp.Api.Controllers.HomeController", - "Api.Controllers.HomeController" - }; - - var overrides = new Dictionary - { - ["MyApp"] = new(LogEventLevel.Debug), - ["MyApp.Api.Controllers"] = new(LogEventLevel.Information), - ["MyApp.Api.Controllers.HomeController"] = new(LogEventLevel.Warning), - ["MyApp.Api"] = new(LogEventLevel.Error) - }; - - _levelOverrideMap = new(overrides, LogEventLevel.Fatal, null); - - var loggerConfiguration = new LoggerConfiguration().MinimumLevel.Fatal(); - - foreach (var @override in overrides) - { - loggerConfiguration = loggerConfiguration.MinimumLevel.Override(@override.Key, @override.Value); - - foreach (var ctx in _contexts) - { - _loggersWithFilters.Add( - new LoggerConfiguration().MinimumLevel.Verbose() - .Filter.ByIncludingOnly(Matching.FromSource(@override.Key)) - .WriteTo.Sink() - .CreateLogger() - .ForContext(Constants.SourceContextPropertyName, ctx)); - } - } - - _loggerWithOverrides = loggerConfiguration.WriteTo.Sink().CreateLogger(); - } - - [Benchmark] - public void Filter_MatchingFromSource() - { - for (var i = 0; i < _loggersWithFilters.Count; ++i) - { - _loggersWithFilters[i].Write(_event); - } - } - - [Benchmark] - public void Logger_ForContext() - { - for (var i = 0; i < _contexts.Length; ++i) - { - _loggerWithOverrides.ForContext(Constants.SourceContextPropertyName, _contexts[i]); - } - } - - [Benchmark] - public void LevelOverrideMap_GetEffectiveLevel() - { - for (var i = 0; i < _contexts.Length; ++i) - { - _levelOverrideMap.GetEffectiveLevel(_contexts[i], out _, out _); - } - } -} diff --git a/test/Serilog.PerformanceTests/Support/ConcurrentDictionaryTemplateCache.cs b/test/Serilog.PerformanceTests/Support/ConcurrentDictionaryTemplateCache.cs deleted file mode 100644 index e3201d7fd..000000000 --- a/test/Serilog.PerformanceTests/Support/ConcurrentDictionaryTemplateCache.cs +++ /dev/null @@ -1,46 +0,0 @@ -namespace Serilog.PerformanceTests.Support; - -class ConcurrentDictionaryMessageTemplateCache : IMessageTemplateParser -{ - readonly IMessageTemplateParser _innerParser; - - readonly ConcurrentDictionary _templates = new(); - - const int MaxCacheItems = 1000; - const int MaxCachedTemplateLength = 1024; - - public ConcurrentDictionaryMessageTemplateCache(IMessageTemplateParser innerParser) - { - _innerParser = Guard.AgainstNull(innerParser); - } - - public MessageTemplate Parse(string messageTemplate) - { - Guard.AgainstNull(messageTemplate); - - if (messageTemplate.Length > MaxCachedTemplateLength) - return _innerParser.Parse(messageTemplate); - - if (_templates.TryGetValue(messageTemplate, out var result)) - return result; - - result = _innerParser.Parse(messageTemplate); - - { - // Exceeding MaxCacheItems is *not* the sunny day scenario; all we're doing here is preventing out-of-memory - // conditions when the library is used incorrectly. Correct use (templates, rather than - // direct message strings) should barely, if ever, overflow this cache. - - // Changing workloads through the lifecycle of an app instance mean we can gain some ground by - // potentially dropping templates generated only in startup, or only during specific infrequent - // activities. - - if (_templates.Count == MaxCacheItems) - _templates.Clear(); - - _templates[messageTemplate] = result; - } - - return result; - } -} diff --git a/test/Serilog.PerformanceTests/Support/DictionaryMessageTemplateCache.cs b/test/Serilog.PerformanceTests/Support/DictionaryMessageTemplateCache.cs deleted file mode 100644 index d58f12951..000000000 --- a/test/Serilog.PerformanceTests/Support/DictionaryMessageTemplateCache.cs +++ /dev/null @@ -1,50 +0,0 @@ -namespace Serilog.PerformanceTests.Support; - -class DictionaryMessageTemplateCache : IMessageTemplateParser -{ - readonly IMessageTemplateParser _innerParser; - readonly object _templatesLock = new(); - - readonly Dictionary _templates = new(); - - const int MaxCacheItems = 1000; - const int MaxCachedTemplateLength = 1024; - - public DictionaryMessageTemplateCache(IMessageTemplateParser innerParser) - { - _innerParser = Guard.AgainstNull(innerParser); - } - - public MessageTemplate Parse(string messageTemplate) - { - Guard.AgainstNull(messageTemplate); - - if (messageTemplate.Length > MaxCachedTemplateLength) - return _innerParser.Parse(messageTemplate); - - MessageTemplate? result; - lock (_templatesLock) - if (_templates.TryGetValue(messageTemplate, out result)) - return result; - - result = _innerParser.Parse(messageTemplate); - - lock (_templatesLock) - { - // Exceeding MaxCacheItems is *not* the sunny day scenario; all we're doing here is preventing out-of-memory - // conditions when the library is used incorrectly. Correct use (templates, rather than - // direct message strings) should barely, if ever, overflow this cache. - - // Changing workloads through the lifecycle of an app instance mean we can gain some ground by - // potentially dropping templates generated only in startup, or only during specific infrequent - // activities. - - if (_templates.Count == MaxCacheItems) - _templates.Clear(); - - _templates[messageTemplate] = result; - } - - return result; - } -} diff --git a/test/Serilog.PerformanceTests/Support/NoOpMessageTemplateParser.cs b/test/Serilog.PerformanceTests/Support/NoOpMessageTemplateParser.cs deleted file mode 100644 index a1fe3fa2b..000000000 --- a/test/Serilog.PerformanceTests/Support/NoOpMessageTemplateParser.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Serilog.PerformanceTests.Support; - -class NoOpMessageTemplateParser : IMessageTemplateParser -{ - public static readonly NoOpMessageTemplateParser Instance = new(); - - static readonly MessageTemplate ConstTemplate = new("text", Enumerable.Empty()); - - public MessageTemplate Parse(string messageTemplate) => ConstTemplate; -} diff --git a/test/Serilog.PerformanceTests/Support/NullSink.cs b/test/Serilog.PerformanceTests/Support/NullSink.cs deleted file mode 100644 index a3574a9d6..000000000 --- a/test/Serilog.PerformanceTests/Support/NullSink.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Serilog.PerformanceTests.Support; - -class NullSink : ILogEventSink -{ - public void Emit(LogEvent logEvent) - { - } -} diff --git a/test/Serilog.PerformanceTests/Support/NullTextWriter.cs b/test/Serilog.PerformanceTests/Support/NullTextWriter.cs deleted file mode 100644 index 218f5ac6d..000000000 --- a/test/Serilog.PerformanceTests/Support/NullTextWriter.cs +++ /dev/null @@ -1,152 +0,0 @@ -namespace Serilog.PerformanceTests.Support; - -class NullTextWriter : TextWriter -{ - public override void Write(char value) - { - } - - public override Encoding Encoding { get; } = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false); - - public override void Write(bool value) - { - } - - public override void Write(char[]? buffer) - { - } - - public override void Write(char[] buffer, int index, int count) - { - } - - public override void Write(decimal value) - { - } - - public override void Write(double value) - { - } - - public override void Write(int value) - { - } - - public override void Write(long value) - { - } - - public override void Write(object? value) - { - } - - public override void Write(float value) - { - } - - public override void Write(string? value) - { - } - - public override void Write(string format, object? arg0) - { - } - - public override void Write(string format, object? arg0, object? arg1) - { - } - - public override void Write(string format, object? arg0, object? arg1, object? arg2) - { - } - - public override void Write(string format, params object?[] arg) - { - } - - public override void Write(uint value) - { - } - - public override void Write(ulong value) - { - } - - public override string ToString() => string.Empty; - - public override void Flush() - { - } - - public override void WriteLine() - { - } - - public override void WriteLine(bool value) - { - } - - public override void WriteLine(char value) - { - } - - public override void WriteLine(char[]? buffer) - { - } - - public override void WriteLine(char[] buffer, int index, int count) - { - } - - public override void WriteLine(decimal value) - { - } - - public override void WriteLine(double value) - { - } - - public override void WriteLine(int value) - { - } - - public override void WriteLine(long value) - { - } - - public override void WriteLine(object? value) - { - } - - public override void WriteLine(float value) - { - } - - public override void WriteLine(string? value) - { - } - - public override void WriteLine(string format, object? arg0) - { - } - - public override void WriteLine(string format, object? arg0, object? arg1) - { - } - - public override void WriteLine(string format, object? arg0, object? arg1, object? arg2) - { - } - - public override void WriteLine(string format, params object?[] arg) - { - } - - public override void WriteLine(uint value) - { - } - - public override void WriteLine(ulong value) - { - } -} diff --git a/test/Serilog.PerformanceTests/Support/Some.cs b/test/Serilog.PerformanceTests/Support/Some.cs deleted file mode 100644 index df0942955..000000000 --- a/test/Serilog.PerformanceTests/Support/Some.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Serilog.PerformanceTests.Support; - -static class Some -{ - public static LogEvent InformationEvent(string messageTemplate = "Hello, world!", params object[] propertyValues) - { - var logger = new LoggerConfiguration().CreateLogger(); -#pragma warning disable Serilog004 // Constant MessageTemplate verifier - logger.BindMessageTemplate(messageTemplate, propertyValues, out var parsedTemplate, out var boundProperties); -#pragma warning restore Serilog004 // Constant MessageTemplate verifier - return new LogEvent(DateTime.Now, LogEventLevel.Information, null, parsedTemplate!, boundProperties!); - } -} diff --git a/test/Serilog.PerformanceTests/xunit.runner.json b/test/Serilog.PerformanceTests/xunit.runner.json deleted file mode 100644 index 34b2fe2cd..000000000 --- a/test/Serilog.PerformanceTests/xunit.runner.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "shadowCopy": false -} \ No newline at end of file diff --git a/test/Serilog.Tests/Serilog.Tests.csproj b/test/Serilog.Tests/Serilog.Tests.csproj index 1ddb6e165..20ccd9ef0 100644 --- a/test/Serilog.Tests/Serilog.Tests.csproj +++ b/test/Serilog.Tests/Serilog.Tests.csproj @@ -6,7 +6,6 @@ - diff --git a/test/TestDummies/Console/DummyConsoleSink.cs b/test/Serilog.Tests/TestDummies/Console/DummyConsoleSink.cs similarity index 100% rename from test/TestDummies/Console/DummyConsoleSink.cs rename to test/Serilog.Tests/TestDummies/Console/DummyConsoleSink.cs diff --git a/test/TestDummies/Console/Themes/ConcreteConsoleTheme.cs b/test/Serilog.Tests/TestDummies/Console/Themes/ConcreteConsoleTheme.cs similarity index 100% rename from test/TestDummies/Console/Themes/ConcreteConsoleTheme.cs rename to test/Serilog.Tests/TestDummies/Console/Themes/ConcreteConsoleTheme.cs diff --git a/test/TestDummies/Console/Themes/ConsoleTheme.cs b/test/Serilog.Tests/TestDummies/Console/Themes/ConsoleTheme.cs similarity index 100% rename from test/TestDummies/Console/Themes/ConsoleTheme.cs rename to test/Serilog.Tests/TestDummies/Console/Themes/ConsoleTheme.cs diff --git a/test/TestDummies/Console/Themes/ConsoleThemes.cs b/test/Serilog.Tests/TestDummies/Console/Themes/ConsoleThemes.cs similarity index 100% rename from test/TestDummies/Console/Themes/ConsoleThemes.cs rename to test/Serilog.Tests/TestDummies/Console/Themes/ConsoleThemes.cs diff --git a/test/TestDummies/Console/Themes/EmptyConsoleTheme.cs b/test/Serilog.Tests/TestDummies/Console/Themes/EmptyConsoleTheme.cs similarity index 100% rename from test/TestDummies/Console/Themes/EmptyConsoleTheme.cs rename to test/Serilog.Tests/TestDummies/Console/Themes/EmptyConsoleTheme.cs diff --git a/test/TestDummies/DummyAnonymousUserFilter.cs b/test/Serilog.Tests/TestDummies/DummyAnonymousUserFilter.cs similarity index 100% rename from test/TestDummies/DummyAnonymousUserFilter.cs rename to test/Serilog.Tests/TestDummies/DummyAnonymousUserFilter.cs diff --git a/test/TestDummies/DummyHardCodedStringDestructuringPolicy.cs b/test/Serilog.Tests/TestDummies/DummyHardCodedStringDestructuringPolicy.cs similarity index 100% rename from test/TestDummies/DummyHardCodedStringDestructuringPolicy.cs rename to test/Serilog.Tests/TestDummies/DummyHardCodedStringDestructuringPolicy.cs diff --git a/test/TestDummies/DummyLoggerConfigurationExtensions.cs b/test/Serilog.Tests/TestDummies/DummyLoggerConfigurationExtensions.cs similarity index 100% rename from test/TestDummies/DummyLoggerConfigurationExtensions.cs rename to test/Serilog.Tests/TestDummies/DummyLoggerConfigurationExtensions.cs diff --git a/test/TestDummies/DummyReduceVersionToMajorPolicy.cs b/test/Serilog.Tests/TestDummies/DummyReduceVersionToMajorPolicy.cs similarity index 100% rename from test/TestDummies/DummyReduceVersionToMajorPolicy.cs rename to test/Serilog.Tests/TestDummies/DummyReduceVersionToMajorPolicy.cs diff --git a/test/TestDummies/DummyRollingFileAuditSink.cs b/test/Serilog.Tests/TestDummies/DummyRollingFileAuditSink.cs similarity index 100% rename from test/TestDummies/DummyRollingFileAuditSink.cs rename to test/Serilog.Tests/TestDummies/DummyRollingFileAuditSink.cs diff --git a/test/TestDummies/DummyRollingFileSink.cs b/test/Serilog.Tests/TestDummies/DummyRollingFileSink.cs similarity index 100% rename from test/TestDummies/DummyRollingFileSink.cs rename to test/Serilog.Tests/TestDummies/DummyRollingFileSink.cs diff --git a/test/TestDummies/DummyThreadIdEnricher.cs b/test/Serilog.Tests/TestDummies/DummyThreadIdEnricher.cs similarity index 100% rename from test/TestDummies/DummyThreadIdEnricher.cs rename to test/Serilog.Tests/TestDummies/DummyThreadIdEnricher.cs diff --git a/test/TestDummies/DummyWithLevelSwitchSink.cs b/test/Serilog.Tests/TestDummies/DummyWithLevelSwitchSink.cs similarity index 100% rename from test/TestDummies/DummyWithLevelSwitchSink.cs rename to test/Serilog.Tests/TestDummies/DummyWithLevelSwitchSink.cs diff --git a/test/TestDummies/DummyWrappingSink.cs b/test/Serilog.Tests/TestDummies/DummyWrappingSink.cs similarity index 100% rename from test/TestDummies/DummyWrappingSink.cs rename to test/Serilog.Tests/TestDummies/DummyWrappingSink.cs diff --git a/test/TestDummies/GlobalUsings.cs b/test/Serilog.Tests/TestDummies/GlobalUsings.cs similarity index 100% rename from test/TestDummies/GlobalUsings.cs rename to test/Serilog.Tests/TestDummies/GlobalUsings.cs diff --git a/test/TestDummies/TestDummies.csproj b/test/TestDummies/TestDummies.csproj deleted file mode 100644 index a8a02524a..000000000 --- a/test/TestDummies/TestDummies.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - ../../assets/Serilog.snk - false - false - false - net452 - false - - - - - - - -