I was using taggit in a form and noticed whenever the form was saved, Taggit would delete and recreate all the entries in the taggeditem table, issuing a load of database queries. set() in TaggableManager was being called, which, clears all the tags and then re-adds them.
I updated this so it only issues queries for tags that are added and removed.
Avoids deleting and re-creating entries in the taggeditems table when…
… using set(), causing autoincrement primary keys to increment needlessly
… using set()
Confirmed, tests pass;
.add uses bulk_create nowadays so this should no longer be an issue.