Replies: 2 comments 1 reply
-
Yes, we think it is.
Correct.
As long you're not working with recurrence this should be quite straightforward
Complex calendars are not necessarily the big ones. Complexity rather comes from recurrence, DST transitions, timezones, the number of iCalendar components et al.
It depends. If in-memory processing is a show stopper, it's not, just because other ways are not what the current architecture supports. |
Beta Was this translation helpful? Give feedback.
-
|
Not sure whether a calendar with 5,000 events comes close to what you have in mind: [MemoryDiagnoser]
public class BigCalendarTests
{
private Calendar? _calendar = null;
[GlobalSetup]
public void Setup()
{
CreateCalendar();
}
[Benchmark]
public void CreateCalendar()
{
// Create a new calendar
_calendar = new Calendar();
// Add 5000 events to the calendar
for (var i = 0; i < 5000; i++)
{
var calEvent = new CalendarEvent
{
Summary = $"Event {i + 1}",
Description = $"Description for event {i + 1}",
Start = CalDateTime.Now.AddDays(i),
End = CalDateTime.Now.AddDays(i).AddHours(1),
Location = $"Location {i + 1}",
Uid = Guid.NewGuid().ToString()
};
_calendar.Events.Add(calEvent);
}
}
[Benchmark]
public void GetOccurrences()
{
_ = _calendar!.GetOccurrences<CalendarEvent>().ToList();
}
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently designing an API that will have to maintain a lot of resource allocations, and was thinking about leveraging standards like iCal to manage those (at the end of the day, I need to visualize everything in a calendar-like UI anyway).
iCal.net looks mature, but glancing at the API, it seems to be working mostly on top of files / streams, which implies that the calendar is loaded in full into memory? I'd rather have entries in a database, query them based on start/end times and then do further processing to determine the actual slots - reading the full calendar is not an option.
Is that something ICal is a good fit, or would that lead to hackery? To my surprise, I didn't find any discussions on that very topic. How are you dealing with big / complex calendars in your APIs?
Thanks for your advice :)
Philipp
Beta Was this translation helpful? Give feedback.
All reactions