#1155 ✓resolved
Greg Campbell

dm-timestamps causes major (100x in this example) slowdowns when creating multiple children at once

Reported by Greg Campbell | December 16th, 2009 @ 12:08 PM

In the script at http://gist.github.com/258013, requiring dm-timestamps reproducibly causes the operation to run over 100 times times slower, even if there are no timestamp properties used. Furthermore, adding timestamp properties worsens the problem, as the parent and grandparent node will be re-saved for every child saved in the list. I believe the problem to be the following:

  • for each child node saved, save_parents is called
  • this triggers dm-timestamps' set_timestamps_on_save method
  • set_timestamps_on_save returns unless dirty? is true. dirty? recursively calls dirty_parents? and dirty_children?, and will be true until all children have been saved, as I understand it

One solution would be to check dirty_self? rather than dirty?, but that's api private at this point.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Attachments

Referenced by

Pages