Drag cue moving slow...

7 posts, 0 answers
  1. Pedro
    Pedro avatar
    22 posts
    Member since:
    Apr 2008

    Posted 12 Oct 2009 Link to this post

    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.
  2. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 16 Oct 2009 Link to this post

    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.
  3. Pedro
    Pedro avatar
    22 posts
    Member since:
    Apr 2008

    Posted 02 Dec 2009 Link to this post

    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.

  4. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 08 Dec 2009 Link to this post

    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.
  5. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 08 Dec 2009 Link to this post

    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.
  6. Pedro
    Pedro avatar
    22 posts
    Member since:
    Apr 2008

    Posted 08 Dec 2009 Link to this post

    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.
  7. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 08 Dec 2009 Link to this post

    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.
Back to Top