Speed up the creation and publishing of drafts.

Review Request #5339 — Created Jan. 27, 2014 and submitted


Review Board


Speed up the creation and publishing of drafts.

This massively reduces the number and complexity of queries needed to
both create review request drafts and to publish them. This code was old
and predated things like the F() queries and update_fields=. It also
took an ignorant approach to updating lists of ManyToManyFields.

We now make use of all three approaches to substantially reduce the
number of queries we have to perform, and to keep those queries simpler.

While in there, I also fixed copying over extra_data into the draft,
which was missing before.

Tested creating drafts with file attachments and other data. The data
carried over. I was able to publish it without problems. It all felt
a lot faster.

Unit tests passed, and had a small speed improvement.

  1. Ship It!
Review request changed

Status: Closed (submitted)