Splitting this bit off from #721436: Remove magical fairy saving of cruft from user_save(). In user_save(), when saving a new user, we do a user_load() only to get information we already know. This cuts 300 off the 1,300 database hits I'm seeing when using devel generated to create 100 users.

Patch is entirely by Moshe, this is just a re-roll. If the tests all pass then it should be RTBC.

Comments

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

take your pick. catch and i split patch author and reviewer roles on this.

moshe weitzman’s picture

Issue tags: +migration
catch’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new1.09 KB

I opened a separate issue for #745702: Remove duff user_load() when new users are created but turns out the test failures there disappear when these patches are combined. So here's both together - all the failing tests pass locally for me.

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

Well that works out nicely. RTBC.

mikeryan’s picture

Ditto - in my performance testing, this slims down user_save() to the point where the heavy hitter time-wise is the db_next_id() call.

catch’s picture

Issue tags: -Performance, -migration

#3: bogus_user_loads.patch queued for re-testing.

Status: Reviewed & tested by the community » Needs work
Issue tags: +Performance, +migration

The last submitted patch, bogus_user_loads.patch, failed testing.

catch’s picture

Status: Needs work » Needs review
StatusFileSize
new1.09 KB

Re-rolled.

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

Status: Reviewed & tested by the community » Needs work

The last submitted patch, bogus_user_loads.patch, failed testing.

catch’s picture

Status: Needs work » Needs review
StatusFileSize
new1.64 KB

Fixing test failures, which also happens to fix chx's complaint with the user->data patch.

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community
dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

mfb’s picture

Priority: Normal » Critical
Status: Fixed » Needs work
StatusFileSize
new816 bytes

This is broken: Now there is nothing to unserialize user->data so it gets more and more serialized each time you save a profile category page.

If we don't unserialize $user->data here when the user is being saved, then we need to unserialize it earlier, like when the user is being loaded.

Although maybe there should be something in the base entity controller to automatically unserialize any serialized schema fields on load?

mfb’s picture

Status: Needs work » Needs review

Might as well see if this passes tests. Although this is pretty lame, $user->data ends up getting unserialized twice in a row by drupal_unpack() and unserialize()

catch’s picture

Moving this back to fixed, dealt with in #721436: Remove magical fairy saving of cruft from user_save().

catch’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)
Issue tags: -Performance, -migration

Automatically closed -- issue fixed for 2 weeks with no activity.