Don't node_load original node on new revisions

DeFr - May 22, 2009 - 13:25
Project:FileField
Version:6.x-3.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

In filefield_field_update, the code checks if it's processing a new node, and if it is, it returns early as there can't be any old items to delete. The very same check could be used on new node revisions, as the files won't be deleted either and it saves a few cycles not to node_load the original node.

The performance hit isn't huge in normal operations, but bites quite more when batch processing a lot of nodes :-)

AttachmentSize
filefield_return_early_on_new_revision.patch1 KB

#1

DeFr - May 22, 2009 - 13:35
Status:needs work» needs review

I've just checked and the patch seems to still applies cleanly to 3.x-dev (it was made against the 3.0 release), so I guess this needs review :-)

#2

quicksketch - May 22, 2009 - 15:45

Makes sense to me. I should be able to put this in next time I'm applying patches.

#3

quicksketch - July 3, 2009 - 22:47
Status:needs review» fixed

Committed. Thanks!

#4

System Message - July 17, 2009 - 22:50
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.