DDC-788: Metadata Caching with var_export #968

Closed
opened 2026-01-22 12:57:39 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Sep 4, 2010).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user @beberlei:

An improvement in the metadata caching strategy was brought to my attention.

Instead of serializing away the instance, we could var_export() it, implement ClassMetadataInfo::__var_export() and write that to a file and require it:

<?php
return classMetadataInfo::**varExport(...);

Advantages:

  1. No serialize/unserialize overhead
  2. Metadata is still cached in op-code cache (APC) since its just a PHP file...
  3. This can be done with a new cache driver

Disadvantages:

  1. Needs a new directory to write code to.
Originally created by @doctrinebot on GitHub (Sep 4, 2010). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user @beberlei: An improvement in the metadata caching strategy was brought to my attention. Instead of serializing away the instance, we could var_export() it, implement ClassMetadataInfo::__var_export() and write that to a file and require it: ``` <?php return classMetadataInfo::**varExport(...); ``` Advantages: 1. No serialize/unserialize overhead 2. Metadata is still cached in op-code cache (APC) since its just a PHP file... 3. This can be done with a new cache driver Disadvantages: 1. Needs a new directory to write code to.
admin added the Improvement label 2026-01-22 12:57:39 +01:00
admin closed this issue 2026-01-22 12:57:40 +01:00
Author
Owner

@doctrinebot commented on GitHub (Sep 4, 2010):

Comment created by romanb:

For what its worth, I tried this once and gave up on the idea due to the fact that there were no noticable performance gains.

@doctrinebot commented on GitHub (Sep 4, 2010): Comment created by romanb: For what its worth, I tried this once and gave up on the idea due to the fact that there were no noticable performance gains.
Author
Owner

@doctrinebot commented on GitHub (Sep 4, 2010):

Comment created by @beberlei:

I developed this in a branch to test the performance, and it was worse than APC. So this issue can be dropped.

@doctrinebot commented on GitHub (Sep 4, 2010): Comment created by @beberlei: I developed this in a branch to test the performance, and it was worse than APC. So this issue can be dropped.
Author
Owner

@doctrinebot commented on GitHub (Sep 4, 2010):

Issue was closed with resolution "Invalid"

@doctrinebot commented on GitHub (Sep 4, 2010): Issue was closed with resolution "Invalid"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#968