Tested with Aspose.Email version 6.7
We have observed a significant performance difference for recurrence generation depending on the start time’s difference from the window of generation. For example, we have a pattern that generates every 5 minutes. We have a start date/time of 7/16/14 with no end date. We then generate occurrences from 8/1/15 - 8/31/15. It took about 22 seconds to generate the 8641 occurrences. In contrast, it took only .5 of a second to generate the 8641 occurrences between 8/1/14 - 8/31/14.
Test:
pattern = new CalendarRecurrence(“DTSTART:20140716T150000\r\nRRULE:FREQ = DAILY; BYHOUR = 4,3,2,1,8,7,6,5,9,10,11,12,13,16,15,14,18,19,20,17,21,0,23,22; BYMINUTE = 5,10,15,20,25,30,35,40,45,50,55,0”);
var sw = new StopWatch();
sw.Start();
var dates = pattern.GenerateOccurrences(new DateTime(2014, 8, 1, 0, 0, 0), new DateTime(2014, 8, 31, 0, 0, 0));
sw.Stop();
// sw.ElapsedMilliseconds ~ 500
Assert(dates.Count == 8641);
sw.Start();
dates = pattern.GenerateOccurrences(new DateTime(2015, 8, 1, 0, 0, 0), new DateTime(2015, 8, 31, 0, 0, 0));
sw.Stop();
// sw.ElapsedMilliseconds ~ 22000
Assert(dates.Count == 8641);
Regards,
Tim