Add new comment

That's certainly a good point, but I would be wary of using node_load_multiple() if you're going to have very large result sets. It's fine IMHO to use it for maybe 5 or 10 nodes (e.g. a nodereference or entityreference field) but the data I've been working on has returned 100s or 1000s of them.

At that point, you would want to: load each node in turn; keep overwriting the $node and $wrapped_node variables; and let PHP's garbage collection remove the older nodes and EMW objects from memory for you (it might need an unset() hint, I'm not sure.) However, if you're loading the whole data set at the start, then doing more complex manipulations on each node in turn, then on big, complex sites you're liable to run out of memory before you finish.

It's definitely worth looking at on a case-by-case basis, though.