[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Good day,

One of the recent changes to the driver has been to adjust the code that
invalidates the method cache.  This change is still in progress.

Currently, the method cache gets invalidated on these actions:
 * adding a method
 * changing the access of a method
 * deleting a method
 * destroying an object
 * changing the parents of an object

With the way that ColdCore currently operates, this has a really negative
impact on the method cache.  Every time a network connection closes, the
cache is cleared.  Every eval command run clears the cache.  Every time you
edit an existing method, the cache gets cleared.  There is obviously some
ground to be gained here.

I've already made some fixes:
 * If an object that is being destroyed has no children
   or methods, then there isn't a need to invalidate the
   entire cache, only the entries that mention that object.
 * The method cache only cares about methods that have
   'frob' access.  So, we need only invalidate the cache
   when the access changes from or to 'frob' access.
 * Only invalidate the method cache in deleting a method
   when you actually delete the method.

Things we could do but don't yet:
 * When adding a method to do an eval, and then deleting
   the method, signify somehow that it is temporary and
   should not be cached or affect the cache.  This could
   also be handled by potentially adding an eval_method()
   built-in to the driver.
 * If an object has no children or methods, and is the
   subject of a call to change_parents(), then, you could
   follow a strategy of invalidation similar to that taken
   during the destruction of an object.
 * When editing a method, add_method() is called.  This
   invalidates the cache.  It then deletes the method,
   which again invalidates the cache.  All of this is
   not needed since all we are doing is editing the code
   for an existing method.  This should be simple to fix,
   but is just a matter of the time needed.

Am I missing some optimizations?  Thoughts on how to handle the eval method?
Is there likely to be a problem with one of these changes?

 - Bruce