The harvest_images_from_node() method returns all images from image fields and the node body, while only one is actually being used.
It is a waste of processing power to parse the node body using libxml for nodes that have image fields. I can understand that a future enhancement of this module could be that multiple og:image meta tags are returned, as Facebook supports this. In order to improve performance, and allow this future enhancement, the harvest_images_from_node() method should have a limit parameter that determines how many images are returned. For now, this limit can be hardcoded to one, but in the future this may be configurable.
Comment | File | Size | Author |
---|---|---|---|
#1 | 1341930-harvest-performance-d6.patch | 5.41 KB | Jorrit |
#1 | 1341930-harvest-performance-d7.patch | 3.56 KB | Jorrit |
Comments
Comment #1
Jorrit CreditAttribution: Jorrit commentedI have added patches for 6.x-1.x and 7.x-1.x that add a limit to the number of retrieved images. This saves the XML operation when the node contains image fields.
Comment #2
Jorrit CreditAttribution: Jorrit commented