DDC-519: Consider turning public ClassMetadataInfo properties into a hash/array #647

Closed
opened 2026-01-22 12:45:32 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Apr 14, 2010).

Jira issue originally created by user romanb:

Currently all the different mapping info is stored in separate properties on ClassMetadataInfo even though in many cases most of the properties are not used / remain blank. Moving all the properties into a hash, where they are never actually created if they dont exist can potentially improve unserialization performance.

On a regular entity with no inheritance or versioning etc. the following properties remain unused, yet participate in serialization/unserialization with caching:

  • customRepositoryClassName
  • discriminatorColumn
  • discriminatorValue
  • discriminatorMap
  • inheritedAssociationFields
  • isMappedSuperclass
  • isVersioned
  • lifecycleCallbacks
  • parentClasses
  • subClasses
  • sequenceGeneratorDefinition
  • tableGeneratorDefinition
  • versionField

NOTE: The first thing that needs to be done is to evaluate whether there is an actual noticable improvement from doing this. Mainly unserialization performance is of interest. Its probably easy to do a microbenchmark with artificial classes, one with a lot of individual properties, the other with a single array property.

This might also have a positive effect on no/less overhead when adding new mapping features (we dont need new properties). I am also curious what effects the upcoming performance patches for PHP trunk have on the Doctrine code, especially string interning which will positively influence performance of string keys in arrays.

Originally created by @doctrinebot on GitHub (Apr 14, 2010). Jira issue originally created by user romanb: Currently all the different mapping info is stored in separate properties on ClassMetadataInfo even though in many cases most of the properties are not used / remain blank. Moving all the properties into a hash, where they are never actually created if they dont exist can potentially improve unserialization performance. On a regular entity with no inheritance or versioning etc. the following properties remain unused, yet participate in serialization/unserialization with caching: - customRepositoryClassName - discriminatorColumn - discriminatorValue - discriminatorMap - inheritedAssociationFields - isMappedSuperclass - isVersioned - lifecycleCallbacks - parentClasses - subClasses - sequenceGeneratorDefinition - tableGeneratorDefinition - versionField NOTE: The first thing that needs to be done is to evaluate whether there is an actual noticable improvement from doing this. Mainly unserialization performance is of interest. Its probably easy to do a microbenchmark with artificial classes, one with a lot of individual properties, the other with a single array property. This might also have a positive effect on no/less overhead when adding new mapping features (we dont need new properties). I am also curious what effects the upcoming performance patches for PHP trunk have on the Doctrine code, especially string interning which will positively influence performance of string keys in arrays.
admin added the Improvement label 2026-01-22 12:45:32 +01:00
admin closed this issue 2026-01-22 12:45:34 +01:00
Author
Owner

@doctrinebot commented on GitHub (Apr 26, 2010):

Comment created by romanb:

First tests showed no noticable improvement by doing this. Instead serializing has been improved by only serializing what is necessary.
Furthermore association mappings might be replaced with plain arrays in the future (just like field mappings).

@doctrinebot commented on GitHub (Apr 26, 2010): Comment created by romanb: First tests showed no noticable improvement by doing this. Instead serializing has been improved by only serializing what is necessary. Furthermore association mappings might be replaced with plain arrays in the future (just like field mappings).
Author
Owner

@doctrinebot commented on GitHub (Apr 26, 2010):

Issue was closed with resolution "Won't Fix"

@doctrinebot commented on GitHub (Apr 26, 2010): Issue was closed with resolution "Won't Fix"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#647