ErisApps / CatCore

A shared high-performance chat client library written in .NET Standard 2.0
GNU General Public License v3.0
29 stars 3 forks source link

Fix issue where the last letter of self-send messages would get dropped #74

Closed ErisApps closed 1 year ago

ErisApps commented 1 year ago

Fixes #73

This apparently also slightly improved the performance of the logic responsible for splitting up multiple raw irc messages.

Benchmark result comparing the old logic with the newly fixed logic.

BenchmarkDotNet=v0.13.4, OS=Windows 10 (10.0.19044.2604/21H2/November2021Update) AMD Ryzen 9 3900X, 1 CPU, 24 logical and 12 physical cores [Host] : .NET Framework 4.8 (4.8.4614.0), X64 RyuJIT VectorSize=256 Job-CIRMVA : .NET 5.0.17 (5.0.1722.21314), X64 RyuJIT AVX2 Job-NVAYXH : .NET 6.0.14 (6.0.1423.7309), X64 RyuJIT AVX2 Job-ZSFKTD : .NET Framework 4.8 (4.8.4614.0), X64 RyuJIT VectorSize=256 Job-XTWDPN : Mono 5.11.0 (Visual Studio), X86 VectorSize=128 Job-UGEEKR : Mono 6.13.0 (Visual Studio), X86 VectorSize=128 Job-LJOXDK : Mono 6.13.0 (Visual Studio), X86 VectorSize=128

Method Runtime RawIrcMultiMessage Mean Error StdDev StdErr Min Q1 Median Q3 Max Op/s Ratio Baseline Gen0 Allocated Alloc Ratio
InlineSpanBasedSplitBenchmarkFeexed .NET 5.0 :tmi(...)TE\r\n [528] 1,131.7 ns 6.89 ns 6.11 ns 1.63 ns 1,121.1 ns 1,127.6 ns 1,131.8 ns 1,135.7 ns 1,141.7 ns 883,643.8 0.77 No 0.2728 2288 B 1.00
InlineSpanBasedSplitBenchmark .NET 5.0 :tmi(...)TE\r\n [528] 1,478.4 ns 16.42 ns 14.56 ns 3.89 ns 1,461.9 ns 1,467.9 ns 1,471.4 ns 1,486.1 ns 1,505.1 ns 676,419.4 1.00 Yes 0.2728 2288 B 1.00
InlineSpanBasedSplitBenchmarkFeexed .NET 6.0 :tmi(...)TE\r\n [528] 998.5 ns 8.33 ns 7.38 ns 1.97 ns 988.0 ns 992.2 ns 998.1 ns 1,002.5 ns 1,015.3 ns 1,001,513.5 0.84 No 0.2728 2288 B 1.00
InlineSpanBasedSplitBenchmark .NET 6.0 :tmi(...)TE\r\n [528] 1,193.6 ns 9.76 ns 8.66 ns 2.31 ns 1,177.8 ns 1,187.8 ns 1,193.2 ns 1,200.5 ns 1,207.6 ns 837,794.4 1.00 Yes 0.2728 2288 B 1.00
InlineSpanBasedSplitBenchmarkFeexed .NET Framework 4.7.2 :tmi(...)TE\r\n [528] 1,762.9 ns 12.81 ns 11.99 ns 3.09 ns 1,747.3 ns 1,753.5 ns 1,762.1 ns 1,771.2 ns 1,785.4 ns 567,257.4 0.90 No 0.3967 2503 B 1.00
InlineSpanBasedSplitBenchmark .NET Framework 4.7.2 :tmi(...)TE\r\n [528] 1,966.2 ns 7.10 ns 5.93 ns 1.64 ns 1,957.9 ns 1,960.5 ns 1,966.0 ns 1,971.2 ns 1,975.3 ns 508,596.9 1.00 Yes 0.3967 2503 B 1.00
InlineSpanBasedSplitBenchmarkFeexed Mono Unity 2019.4.28f1 :tmi(...)TE\r\n [528] 4,857.3 ns 44.47 ns 39.42 ns 10.53 ns 4,814.6 ns 4,831.3 ns 4,841.6 ns 4,868.3 ns 4,944.2 ns 205,874.2 0.93 No 0.4883 - NA
InlineSpanBasedSplitBenchmark Mono Unity 2019.4.28f1 :tmi(...)TE\r\n [528] 5,232.8 ns 51.28 ns 45.46 ns 12.15 ns 5,187.0 ns 5,204.2 ns 5,215.4 ns 5,257.1 ns 5,327.6 ns 191,101.3 1.00 Yes 0.4883 - NA
InlineSpanBasedSplitBenchmarkFeexed Mono Unity 2021.2.0b4 :tmi(...)TE\r\n [528] 3,548.4 ns 21.69 ns 18.11 ns 5.02 ns 3,516.3 ns 3,537.9 ns 3,545.3 ns 3,559.5 ns 3,580.0 ns 281,816.6 0.92 No 0.4349 - NA
InlineSpanBasedSplitBenchmark Mono Unity 2021.2.0b4 :tmi(...)TE\r\n [528] 3,859.5 ns 34.08 ns 28.46 ns 7.89 ns 3,827.7 ns 3,840.5 ns 3,849.8 ns 3,867.4 ns 3,917.1 ns 259,101.4 1.00 Yes 0.4349 - NA
InlineSpanBasedSplitBenchmarkFeexed Mono Unity 2022.1.0a12 :tmi(...)TE\r\n [528] 3,471.6 ns 25.55 ns 23.90 ns 6.17 ns 3,443.7 ns 3,448.8 ns 3,472.1 ns 3,487.3 ns 3,519.8 ns 288,055.6 0.88 No 0.4349 - NA
InlineSpanBasedSplitBenchmark Mono Unity 2022.1.0a12 :tmi(...)TE\r\n [528] 3,922.2 ns 14.73 ns 12.30 ns 3.41 ns 3,905.0 ns 3,919.0 ns 3,920.5 ns 3,929.6 ns 3,948.7 ns 254,958.4 1.00 Yes 0.4349 - NA