Resources | Resources |




Object creation can be expensive. For example, creating an object type each time you need it can degrade the performance of your code. Depending on the situation, creating an object once and caching it for later use will significantly improve performance. For example, instead of creating an instance of AEECLSID_FileSystem2 each time you want to do a file operation, create a single instance and store the IFileSystem2 interface in an application variable for use in all file operations.

The following are cache optimization considerations in designing data structures and data access:

  • Frequent access to sparse data is non-optimal.
  • Accessing large, one-time use, data sets via cached memory is non-optimal.
  • All CPU-intensive decoding of static data can improve CPU utilization efficiency by using an intermediate software cache. Examples include local data store of graphical elements, fonts, and fully rendered occluded window.
  • Choosing between a most recently used vs most frequently cached element replacement strategy should be decided based on system analysis of the specific UI implementation.