diff --git a/Ical.Net.Benchmarks/ApplicationWorkflows.cs b/Ical.Net.Benchmarks/ApplicationWorkflows.cs index 92aa8b29e..c2e8aa599 100644 --- a/Ical.Net.Benchmarks/ApplicationWorkflows.cs +++ b/Ical.Net.Benchmarks/ApplicationWorkflows.cs @@ -9,6 +9,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using Ical.Net.Evaluation; namespace Ical.Net.Benchmarks; @@ -38,7 +39,7 @@ public List SingleThreaded() return _manyCalendars .SelectMany(Calendar.Load) .SelectMany(c => c.Events) - .SelectMany(e => e.GetOccurrences(_searchStart).TakeWhile(p => p.Period.StartTime < _searchEnd)) + .SelectMany(e => e.GetOccurrences(_searchStart).TakeWhile(p => p.Period.StartTime.LessThan(_searchEnd))) .ToList(); } @@ -49,7 +50,7 @@ public List ParallelUponDeserialize() .AsParallel() .SelectMany(Calendar.Load) .SelectMany(c => c.Events) - .SelectMany(e => e.GetOccurrences(_searchStart).TakeWhile(p => p.Period.StartTime < _searchEnd)) + .SelectMany(e => e.GetOccurrences(_searchStart).TakeWhile(p => p.Period.StartTime.LessThan(_searchEnd))) .ToList(); } @@ -60,7 +61,7 @@ public List ParallelUponGetOccurrences() .SelectMany(Calendar.Load) .SelectMany(c => c.Events) .AsParallel() - .SelectMany(e => e.GetOccurrences(_searchStart).TakeWhile(p => p.Period.StartTime < _searchEnd)) + .SelectMany(e => e.GetOccurrences(_searchStart).TakeWhile(p => p.Period.StartTime.LessThan(_searchEnd))) .ToList(); } @@ -72,7 +73,7 @@ public List ParallelDeserializeSequentialGatherEventsParallelGetOccu .SelectMany(Calendar.Load) .AsSequential() .SelectMany(c => c.Events) - .SelectMany(e => e.GetOccurrences(_searchStart).TakeWhile(p => p.Period.StartTime < _searchEnd)) + .SelectMany(e => e.GetOccurrences(_searchStart).TakeWhile(p => p.Period.StartTime.LessThan(_searchEnd))) .ToList(); } } diff --git a/Ical.Net.Benchmarks/CalDateTimePerfTests.cs b/Ical.Net.Benchmarks/CalDateTimePerfTests.cs index 9fcd21725..52b5f248f 100644 --- a/Ical.Net.Benchmarks/CalDateTimePerfTests.cs +++ b/Ical.Net.Benchmarks/CalDateTimePerfTests.cs @@ -6,6 +6,7 @@ using BenchmarkDotNet.Attributes; using Ical.Net.DataTypes; using System; +using Ical.Net.Evaluation; namespace Ical.Net.Benchmarks; diff --git a/Ical.Net.Benchmarks/OccurencePerfTests.cs b/Ical.Net.Benchmarks/OccurencePerfTests.cs index a17ab58ce..63ee91624 100644 --- a/Ical.Net.Benchmarks/OccurencePerfTests.cs +++ b/Ical.Net.Benchmarks/OccurencePerfTests.cs @@ -9,6 +9,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Ical.Net.Evaluation; namespace Ical.Net.Benchmarks; @@ -35,7 +36,7 @@ public void MultipleEventsWithUntilOccurrencesSearchingByWholeCalendar() { var searchStart = _calendarFourEvents.Events.First().DtStart!.AddYears(-1); var searchEnd = _calendarFourEvents.Events.Last().DtStart!.AddYears(1); - _ = _calendarFourEvents.GetOccurrences(searchStart).TakeWhile(p => p.Period.StartTime < searchEnd); + _ = _calendarFourEvents.GetOccurrences(searchStart).TakeWhile(p => p.Period.StartTime.LessThan(searchEnd)); } [Benchmark] @@ -44,7 +45,7 @@ public void MultipleEventsWithUntilOccurrences() var searchStart = _calendarFourEvents.Events.First().DtStart!.AddYears(-1); var searchEnd = _calendarFourEvents.Events.Last().DtStart!.AddYears(1); _ = _calendarFourEvents.Events - .SelectMany(e => e.GetOccurrences(searchStart).TakeWhile(p => p.Period.StartTime < searchEnd)) + .SelectMany(e => e.GetOccurrences(searchStart).TakeWhile(p => p.Period.StartTime.LessThan(searchEnd))) .ToList(); } @@ -55,7 +56,7 @@ public void MultipleEventsWithUntilOccurrencesEventsAsParallel() var searchEnd = _calendarFourEvents.Events.Last().DtStart!.AddYears(1).AddDays(10); _ = _calendarFourEvents.Events .AsParallel() - .SelectMany(e => e.GetOccurrences(searchStart).TakeWhile(p => p.Period.StartTime < searchEnd)) + .SelectMany(e => e.GetOccurrences(searchStart).TakeWhile(p => p.Period.StartTime.LessThan(searchEnd))) .ToList(); } @@ -113,7 +114,7 @@ public void MultipleEventsWithCountOccurrencesSearchingByWholeCalendar() var calendar = GetFourCalendarEventsWithCountRule(); var searchStart = calendar.Events.First().DtStart!.AddYears(-1); var searchEnd = calendar.Events.Last().DtStart!.AddYears(1); - _ = calendar.GetOccurrences(searchStart).TakeWhile(p => p.Period.StartTime < searchEnd); + _ = calendar.GetOccurrences(searchStart).TakeWhile(p => p.Period.StartTime.LessThan(searchEnd)); } [Benchmark] @@ -123,7 +124,7 @@ public void MultipleEventsWithCountOccurrences() var searchStart = calendar.Events.First().DtStart!.AddYears(-1); var searchEnd = calendar.Events.Last().DtStart!.AddYears(1); _ = calendar.Events - .SelectMany(e => e.GetOccurrences(searchStart).TakeWhile(p => p.Period.StartTime < searchEnd)) + .SelectMany(e => e.GetOccurrences(searchStart).TakeWhile(p => p.Period.StartTime.LessThan(searchEnd))) .ToList(); } @@ -135,7 +136,7 @@ public void MultipleEventsWithCountOccurrencesEventsAsParallel() var searchEnd = calendar.Events.Last().DtStart!.AddYears(1).AddDays(10); _ = calendar.Events .AsParallel() - .SelectMany(e => e.GetOccurrences(searchStart).TakeWhile(p => p.Period.StartTime < searchEnd)) + .SelectMany(e => e.GetOccurrences(searchStart).TakeWhile(p => p.Period.StartTime.LessThan(searchEnd))) .ToList(); } diff --git a/Ical.Net.Benchmarks/ThroughputTests.cs b/Ical.Net.Benchmarks/ThroughputTests.cs index 323676e4e..ff45c8619 100644 --- a/Ical.Net.Benchmarks/ThroughputTests.cs +++ b/Ical.Net.Benchmarks/ThroughputTests.cs @@ -6,6 +6,7 @@ using BenchmarkDotNet.Attributes; using System.Linq; using Ical.Net.DataTypes; +using Ical.Net.Evaluation; namespace Ical.Net.Benchmarks; @@ -70,7 +71,7 @@ rsion 08.00.0681.000"">\n\n\n\n