Recurrence generation performance

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

Hi Tim,


We were able to reproduce this problem at our end and have logged it as performance issue for further consideration by our Product team via issue id: EMAILNET-38423. We’ll update you here once there is some information available in this regard.

The issues you have found earlier (filed as EMAILNET-38423) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Finally got to test your update. It does solve the performance issue.


However, I’m getting a failure on one of my tests that worked under 6.7:

var pattern = new CalendarRecurrence(“DTSTART:20151003T130000\r\nRRULE:FREQ=DAILY;INTERVAL=2;BYHOUR=1”);
var dates = pattern.GenerateOccurrences(new DateTime(2015, 10, 4, 5, 30, 0), new DateTime(2015, 10, 5, 5, 30, 0));
Assert(dates.Count == 1); // Fails - 0 dates are generated. Expectation is to process rule based on time rule (BYHOUR) instead of the start time of the task.

Regards

Tim

Hi Tim,


Thank you for contacting Aspose support team again.

This issue is re-produced and logged under Id:EMAILNET-38478 for further investigation by the product team. You will be automatically notified once any update is received in this regard.

The issues you have found earlier (filed as EMAILNET-38478) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Ok,


The 6.10 build now fails in another spot where 6.7 succeeded.

var pattern = new CalendarRecurrence(“DTSTART:20151003T130000\r\nRRULE:FREQ=DAILY;INTERVAL=2;BYHOUR=1”);
var dates = pattern.GenerateOccurrences(new DateTime(2015, 10, 5, 3, 06, 0), new DateTime(2015, 10, 6, 3, 06, 0));
Assert(dates.Count == 0); // Fails - 1 dates is generated (10/5/15 1 AM). Expectation is to not generate any instance since the given range does not allow for any valid instance.

I have several other tests that are also failing. It seems that 6.10 is ignoring the time portion of the range start to GenerateOccurrences().

Regards,

Tim



Hi Tim,

We were able to reproduce the issue at our end with the new string you have shared with us.

ReportsNow:
Ok,

I have several other tests that are also failing. It seems that 6.10 is ignoring the time portion of the range start to GenerateOccurrences().


Could you please share the other tests as well with us so that we can log the issue for our Product team with all these tests? We'll further assist you accordingly in this regard.
Extracting the pieces dependent on your code, here are the two other unique tests for you that fail:

var pattern = new CalendarRecurrence("DTSTART:20150313T010000\r\nRRULE:FREQ = DAILY;BYHOUR = 0,1,2,3,4,8,7,6,5,9,10,11; BYMINUTE = 5,15,30,45");
var dates = pattern.GenerateOccurrences(new DateTime(2016, 11, 6, 1, 00, 0), new DateTime(2016, 12, 6, 1, 00, 0));
Assert(dates[0] == new DateTime(2016, 11, 6, 1, 05, 0)); // Fails - First date is 12:05 AM

var pattern = new CalendarRecurrence("DTSTART:20150313T010000\r\nRRULE:FREQ = DAILY;BYHOUR = 1,2,3,4,8,7,6,5,9,10,11,12,13,16,15,14,18,19,20,17,21,0,23,22; BYMINUTE = 30");
var dates = pattern.GenerateOccurrences(new DateTime(2016, 3, 13, 1, 00, 0), new DateTime(2016, 4, 13, 1, 00, 0));
Assert(dates[0] == new DateTime(2016, 3, 13, 1, 30, 0)); // Fails - First date is 12:30 AM



This one passes along with many others:

var pattern = new CalendarRecurrence("DTSTART:20150313T010000\r\nRRULE:FREQ = DAILY;BYHOUR = 1,2,3,4,8,7,6,5,9,10,11,12; BYMINUTE = 30");
var dates = pattern.GenerateOccurrences(new DateTime(2016, 11, 6, 1, 00, 0), new DateTime(2016, 11, 7, 1, 00, 0));
Assert(dates.Count == 12); // Succeeds and times are valid.

Regards,
-Tim

Hi Tim,


Thank you for sharing additional information.

We have logged this problem as EMAILNET-38513 in our issue tracking system for further investigation by our Product team. We’ll notify you here once there is some information or a fix version available in this regard.

The issues you have found earlier (filed as EMAILNET-38513) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Just want to let you know that we have tested this fix and it passes all of our tests.


Regards,
-Tim

Hi,


Thank you for sharing your feedback. Please feel free to write to us if you have any further query related to the API.