title: Cache Object in PHP without using serialize
body: <p>I have a complex object that I create in a PHP script. I am looking for a way to store this object such that subsequent requests do not have to recreate it, or spend time unserializing and rebuilding it. Using xdebug I find that I spend half of the entire request time building this object. Even when I store the object explicitly in APC (or memcache), the time to unserialize it and load all of the classes takes almost as long as creating the object in the first place. </p>
  
  <p>I do not know if it is possible to store and later load a "compiled" object in PHP. Is this possible? Are there other solutions?</p>
  
  <p>I am not sure that this is possible, but I thought I should ask the community. </p>
  
  <p>EDIT: The object is a binary tree, and used as a decision tree. The code is basically an API that is required to quickly return an answer from the tree. This all needs to perform at an ever increasing rate so I am trying to maximize the performance wherever possible. </p>