We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Schedule is slow when lots of data is loaded

We have around 500 events loaded in a month, and having unnecessary data manipulation in between actions (change views, selected date,...) seems to be really costly.

Can't really understand how and if the scheduler caches the data, but we would need to have something like the CacheAdaptor, which will not load already loaded data. We get an error when we use the CacheAdaptor, taking in account that it isn't included in your new docs I assume it's still not for regular use.
We are using the UrlAdaptor now.

Another approach we tried is with local data, and although we have full control of the requests to the server (we can do local caching and not send unneeded requests), manipulating the events with scheduleObj.addEvent, scheduleObj.deleteEvent and scheduleObj.saveEvent is much much slower than leaving that problem to the scheduler's data manager.

Also, the schedule obviously freezes the window when these tasks take a long time to process and not sure if there's any async way of doing that.

So, my question is how to improve the schedule's speed when working with a lot of events?

1 Reply

KK Karthigeyan Krishnamurthi Syncfusion Team July 2, 2019 10:58 AM UTC

Hi Vasil, 
 
Syncfusion greetings. 
 
We have checked the reported case in the below sample where nearly 1000 events were loaded and Scheduler took only the reasonable time for rendering it. We internally filter and render the events based on its current view range both on initial load and navigate actions.  
 
JS2 Scheduler will raise post for every CRUD and navigate actions with current view start and end date as parameters. The below url function LoadData will return the filtered data on initial load, every CRUD action and navigate actions. 
 
public eventSettings: EventSettingsModel = {  
    dataSource: new DataManager({  
      url: 'http://localhost:54738/Home/LoadData'// Here need to mention the web api sample running path  
      crudUrl: 'http://localhost:54738/Home/UpdateData',  
      crossDomain: true,  
      adaptor: new UrlAdaptor  
    }),  
  };  
  
public JsonResult LoadData(Params param)  // Here we get the Start and End Date and based on that can filter the data and return to Scheduler  
        {  
            var data = db.ScheduleEventDatas.Where(app => (app.StartTime >= param.StartDate && app.StartTime <= param.EndDate) || (app.RecurrenceRule != null && app.RecurrenceRule != "")).ToList();  // Here filtering the events based on the start and end date value.  
            return Json(data, JsonRequestBehavior.AllowGet);  
        }  
  
public class Params  
        {  
            public DateTime StartDate { getset; }  
            public DateTime EndDate { getset; }  
        }  
 
 
Regards, 
Karthi 


Loader.
Live Chat Icon For mobile
Up arrow icon