This is a migrated thread and some comments may be shown as answers.

Drag cue moving slow...

6 Answers 56 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Pedro
Top achievements
Rank 1
Pedro asked on 12 Oct 2009, 05:02 PM
Hi,
What can be causing that the drag operation is slow, dragging an element, even a Textblock its very slow, most of the times if I move the mouse at normal speed, the visual element its being moved in steps, if I move the mouse fast, I don't even see the element being dragged until I stop moving the mouse, also the CPU % use goes to 50% or more and 40%-50% when I am just hovering the mouse over draggable elements, for test purposes I setting  always true for the QueryResult because I wanted to remove the validation process from the equation, in your drag and drop demo the drag and drop works fine(but the CPU usage goes to 50% when dragging and moving the mouse fast), anyways, what can be causing the problem?

Thanks.

6 Answers, 1 is accepted

Sort by
0
Miroslav
Telerik team
answered on 16 Oct 2009, 12:30 PM
Hi Pedro,

I am sorry for the delayed reply!

There are some performance improvements in the Beta release of the controls which should not be available for download. You will be able to find it as a trial download as well. Could you please download it and check if you see any performance improvements. In the newer version the DragDrop registers for less mouse events.

Generally a the performance of the DragDrop will be affected by two things:
- The depth of the visual tree - since a lot of routed events are used the deeper the visual tree, the longer it will take for them to travel. Also when searching for a drop target the visual tree is searched for elements under the current mouse position, deeper visual hierarchy will degrade the performance.
- The number of drag sources. The DragDrop needs to sign up for mouse events on all drag sources so that it will know when they ar clicked and dragged. If there are many drag sources, this may also degrade the performance.

You say that

"I am just hovering the mouse over draggable elements"

Do you mean that you see this cpu usage without dragging at all? If this is so, can you check how it works with the beta?

From your question it seems that you see performance issues in a simple scenario. Could you possibly send us the project that you use to test this?

You can mail it to miroslav.paskov [at] telerik [dot] com if you cannot open a support ticket.

Best wishes,
Miroslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Pedro
Top achievements
Rank 1
answered on 02 Dec 2009, 07:54 PM
Hi,
Sorry for the late response, in the end I created my own drag and drop library, this is how to reproduce the problem:
Create a Grid with at least 3000 cells, add a drop target control to each cell, add at least one drag source to each cell, add the proper events, for my sample I was just highlighting the drop target and adding some visual information when the drop was valid in the drag cue element.
you will see that the drag operation is slow and it moves in steps(some times the drag cue is not displayed), for test purposes I added a shadow effect to an image and that was my drag cue, it was fatal or the d&d framework.
When I was creating my own library I realized what may be the  problem in your library because my first attempt to create the library gave me similar results, any ways, thanks for your help.


Pedro.

0
Miroslav
Telerik team
answered on 08 Dec 2009, 06:17 PM
Hi Pedro,

Thank you for the additional information!

We indeed optimized the DragDrop in the Q3 release and it should run faster. Of course a custom solution (that does not use routed events for example) can be faster in your case.

I tried to create a project based on your description and I did not experience slowdowns on my machine, hopefully it will be useful for anyone that wants to test the performance for himself in this scenario.

All the best,
Miroslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Miroslav
Telerik team
answered on 08 Dec 2009, 06:20 PM
Hi Pedro,

 I forgot to attach the project, it attached to this reply.

Greetings,

Miroslav
the Telerik team

 


Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Pedro
Top achievements
Rank 1
answered on 08 Dec 2009, 06:39 PM
Hi,
I downloaded your code and I think that I didn't expressed my self correctly, attached you will find my sample project, I am using a Grid not a GridView, sorry for the confusion.


Edited: I guess I cannot attach zip files, so I included an image of my sample poject

Regards, Pedro.
0
Miroslav
Telerik team
answered on 08 Dec 2009, 08:05 PM
Hi Pedro,

I am sorry, I assumed you were talking about a GridView control. 

Thank you for sending us the example, it clearly showed the slow down.

In your case there were ~3000 elements in a single Grid. The current implementation tries to find the visual elements under the mouse and this is slow in this case.

Your Telerik Points have been updated for your feedback.

Kind regards,

Miroslav
the Telerik team

 


Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
General Discussions
Asked by
Pedro
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
Pedro
Top achievements
Rank 1
Share this question
or