This is a general question about how Drupal renders content. Say I have a content type with 20 fields, including some entity references, text fields, integers, and so on.

When I have a lot of fields on a content type, I know that each field slows down operations like saving the content type because each field has to be processed.

However, what about when Drupal renders the content type to display it? If I hide 19 of the 20 fields on "Manage Display" for the content type, will Drupal avoid processing all those fields and have the same performance as rendering a content type that only has 1 field?

  • Given that to render an entity, you first have to load the entity from storage, and Entity::load fetches all fields from the database, there always is an overhead with any additional field. But I doubt this has any real-world relevance. – Hudri Nov 20 '20 at 15:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.