Loading ...
Sorry, an error occurred while loading the content.

DragDrop speed issues

Expand Messages
  • Dave Townsend
    I have an app that utilises the dragdrop library and deals with a large number of draggable items and I am hitting speed problems. I thought I d pass on what
    Message 1 of 4 , Oct 3, 2006
    • 0 Attachment
      I have an app that utilises the dragdrop library and deals with a
      large number of draggable items and I am hitting speed problems. I
      thought I'd pass on what I've found and maybe people will find it
      useful. These were found with Firefox and numbers quoted are averages
      over a couple of runs.

      The first is an issue with instantiating the DDProxys for the objects.
      For some reason the applyConfig function is turning out to be really
      slow. If I make sure the config I pass contains every setting fully
      defined then I find the initialisation time for all proxys drops from
      around 6 to 1.5 seconds. If I replace the applyConfig method itsef to
      something that just sets all the properties correctly, that time drops
      down to around 300ms

      The next is the refreshCache method. So far as I can see there is no
      need to cache the location of anything except drop targets. Indeed
      this possibility appears to have been considered and rejected:

      if (this.isTypeOfDD(oDD)) {
      // if (this.isTypeOfDD(oDD) && oDD.isTarget) {

      For what reason I can't say, but if I change the comments around in
      that code, the startup time of a drag (time from pressing the mouse
      and the frame appearing and being movable) drops from 3.5 seconds to
      300ms.

      Finally, on window resize, resetConstraints is called for every proxy.
      This takes around 3 seconds. I've found that removing these calls
      drops this down to practically nothing and I've not yet discovered any
      regressions, but then my DD items don't actually change their position
      after a window resize.
    • Adam Moore
      ... Thanks for the info, we will take a look at improving the efficiency in the areas you identified. Out of curiosity, how many instances are you creating?
      Message 2 of 4 , Oct 3, 2006
      • 0 Attachment
        On Tue, Oct 03, 2006 at 10:03:59AM -0000, Dave Townsend wrote:
        > I have an app that utilises the dragdrop library and deals with a
        > large number of draggable items and I am hitting speed problems. I
        > thought I'd pass on what I've found and maybe people will find it
        > useful. These were found with Firefox and numbers quoted are averages
        > over a couple of runs.

        Thanks for the info, we will take a look at improving the efficiency in
        the areas you identified. Out of curiosity, how many instances are you
        creating?

        -Adam
      • Dave Townsend
        ... This was with 830 draggable items (none of which were set to act as drop targets) and a single drop target. Dave
        Message 3 of 4 , Oct 3, 2006
        • 0 Attachment
          --- In ydn-javascript@yahoogroups.com, Adam Moore <adamoore@...> wrote:
          > Thanks for the info, we will take a look at improving the efficiency in
          > the areas you identified. Out of curiosity, how many instances are you
          > creating?
          >
          > -Adam
          >

          This was with 830 draggable items (none of which were set to act as
          drop targets) and a single drop target.

          Dave
        • studmanie
          How did you get the DragAndDropManager to not call resetContraints on a window resize? Im new at this :)
          Message 4 of 4 , May 15, 2007
          • 0 Attachment
            How did you get the DragAndDropManager to not call resetContraints on
            a window resize? Im new at this :)

            --- In ydn-javascript@yahoogroups.com, "Dave Townsend" <dave@...> wrote:
            >
            > I have an app that utilises the dragdrop library and deals with a
            > large number of draggable items and I am hitting speed problems. I
            > thought I'd pass on what I've found and maybe people will find it
            > useful. These were found with Firefox and numbers quoted are averages
            > over a couple of runs.
            >
            > The first is an issue with instantiating the DDProxys for the objects.
            > For some reason the applyConfig function is turning out to be really
            > slow. If I make sure the config I pass contains every setting fully
            > defined then I find the initialisation time for all proxys drops from
            > around 6 to 1.5 seconds. If I replace the applyConfig method itsef to
            > something that just sets all the properties correctly, that time drops
            > down to around 300ms
            >
            > The next is the refreshCache method. So far as I can see there is no
            > need to cache the location of anything except drop targets. Indeed
            > this possibility appears to have been considered and rejected:
            >
            > if (this.isTypeOfDD(oDD)) {
            > // if (this.isTypeOfDD(oDD) && oDD.isTarget) {
            >
            > For what reason I can't say, but if I change the comments around in
            > that code, the startup time of a drag (time from pressing the mouse
            > and the frame appearing and being movable) drops from 3.5 seconds to
            > 300ms.
            >
            > Finally, on window resize, resetConstraints is called for every proxy.
            > This takes around 3 seconds. I've found that removing these calls
            > drops this down to practically nothing and I've not yet discovered any
            > regressions, but then my DD items don't actually change their position
            > after a window resize.
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.