On a site with 424 cck fields and 96 content types, nodereference_url_link() executes in 3597.55 ms for 91 executions from node_view(), or about 40 ms per node. On the page tested, this is about 40% of the execution time (this is on my mac dev machine but the times are relative). Given that only nine of the fields use widget_type nodereference_url, this seems like a pretty severe performance penalty.

Comments

dwightaspinwall’s picture

Category: support » feature
Status: Active » Needs review
StatusFileSize
new2.23 KB

Patch provided. This replaces the call to content_fields() with a call to a new function nodereference_url_content_fields() that returns only those fields with instances implementing the nodereference_url widget. Also does a little bit of static caching. On page tested, total time in nodereference_url_link() dropped to 33.38 ms.

dwightaspinwall’s picture

Category: feature » bug

Calling this a bug because, well, modules should scale and be mindful of hook performance. The observation here is that merely turning this module on, without even changing the widget of a single field instance, would add significant load overhead to a large site.