Some initial testing shows unexpected results with multifield taking longer. Not sure if we can optimize things somewhere, or add some extra caching.

Comments

mcrittenden’s picture

I ran a few simple benchmarks in which I create the exact same setup in two different sites, one with multifield and one with field collection (each had an image subfield and 3 text subfields), and added one node with 5 values for the field group into each. This is the result when viewing the node page:

https://gist.github.com/mikecrittenden/6455581

Note that "CACHE" in this place refers to Drupal's built in page caching.

mcrittenden’s picture

I didn't investigate further, but the first thing that came to mind was that since FC's are stored as entities, maybe the internal entity caching is helping speed things up, which obviously multifield can't take advantage of.

steinmb’s picture

Interesting result though. The caching result, is it Drupal core cache or is this with https://drupal.org/project/entitycache?

Anyone looked on memory consumption?

mcrittenden’s picture

steinmb, it's built in Drupal caching (i.e., all the checkboxes on admin/config/development/performance checked without any contrib perf modules added). So no entitycache.

dave reid’s picture

Looks like #2179721: multifield_type_get_fields() is *very* slow might have resolved a big performance issue.

elijah lynn’s picture

Issue summary: View changes

Just throwing this out there. We have some API calls that were doing close to 7,000 Entity loads, we switched to Multifield and the Entity Loads dropped to 4,000. This led to response times from 4-5 seconds to around 1-2 seconds. I have actual data I will post in the future. Until then, just know that this is insanely faster than Field Collections.

Also, yes, we are using Entity Cache and around 40% of the response time was spent in Memcache itself, but 7,000 entity loads from Memcache still takes a while.