search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Performance issue when adding/deleting entity in daypilot

Asked by Veronique
7 years ago.

Hi,

We have some performance issue when we add or delete an entity.

We saw that when adding/removing one entity, daypilot deletes all the entities of the row, and redraw everything using the two methods ( _updateRowsNoLoad and _redrawInvalidatedCells).

This DOM manipulation is costly. Would it be possible to not delete/redraw entities when they are not changing?

Attached is the capture of a timeline - adding 1 entity.

Thank you for your time

Answer posted by Dan Letecky [DayPilot]
7 years ago.

Please hold on - the events.add() and events.remove() optimizations are in the works.

At this moment it redraws the full row because it's always safe (the added/removed event can affect row height and event positions). In some cases (if events don't overlap) it's possible to add/remove the target element without redrawing the row. In the updated implementation, this situation will be detected and the faster update method will be used if possible.

For events.update(), this optimization is already implemented but it needs to be enabled explicitly using "eventUpdateInplaceOptimization" property:

dp.eventUpdateInplaceOptimization = true;

It will use an in-place update of the target event DOM element if the event position and lenght remains the same.

Comment posted by Dan Letecky [DayPilot]
7 years ago.

The latest sandbox build (2840+) now includes optimization of events.add() and events.remove() as well. It is active when eventUpdateInplaceOptimization is set to true:

https://javascript.daypilot.org/sandbox/

Let me know if there is any problem.

Comment posted by Veronique
7 years ago.

Thank you for you answers. We will try this new eventUpdateInplaceOptimization as soon as we can!

Comment posted by Veronique
7 years ago.

Hi Dan,

We would like in integrate the version with those updates. Do you know what version and approx date for those feature?

Thank you

Comment posted by Dan Letecky [DayPilot]
7 years ago.

Veronique,

It's included in the latest release (8.3. SP14, build 2848):
https://javascript.daypilot.org/daypilot-pro-for-javascript-8-3-sp14/

Let me know if there is any problem.

Comment posted by Mauricio
7 years ago.

Hi Dan,
I work with Veronique and we have integrated the latest version of daypilot in our product.
However, delete events is not working anymore if dp.eventUpdateInplaceOptimization = true;

I was investigating why. In your scheduler demo, dp.eventUpdateInplaceOptimization = true; is commented
//dp.eventUpdateInplaceOptimization = true;

So, inside `this.events.remove`, as inplaceEnable is false, it call calendar.events._postponedUpdate(rows); instead and it works. But if you enable this flag, it does not work anymore.
It will call calendar._loadRow(rows[0]); and row[0] in this case is a Number, not a row objec anymore

Could you guys check it to see if my investigation is alright, or if we are missing something?

Thanks

Comment posted by Dan Letecky [DayPilot]
7 years ago.

Hi Mauricio,

Yes, you are right. It has to be replaced by this call:

calendar._loadRow(calendar.rowlist[rows[0]]);

It should be fixed now in the latest sandbox build (2865):

https://javascript.daypilot.org/sandbox/

Let me know if there is any problem.

Comment posted by Mauricio
7 years ago.

Hi Dan,

Thanks for your reply.
Ok, I will update as soon as this build is released (the latest availaible now is "DayPilot Pro for JavaScript 8.3 SP15
Release date: May 26, 2017 (build 8.3.2864)")

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.