[personal profile] tangaroa
Imagine that a computer program's run-time environment is granted sufficient knowledge of the program's internals to become aware that:
  • A particular subroutine takes a significantly long amount of time or processes a significantly large amount of data.
  • The subroutine is known to always produce the same result from the same input.
  • All sources of input to that subroutine are knowable before the subroutine runs.
  • None of the inputs have changed since the last run.

The runtime may ask the operating system to keep a cache of the results in memory after the process exits. The cache may be marked as a low-priority so it will be overwritten if the process does not run that often. The OS will keep a list of cache locations somewhere so that the next run of the run-time environment will know to rewrite the program to look for a cache when it reaches a specific instruction.

Potential benefits:

  • The parsing process will be skipped for any process that reads from a data file.
  • Applied to the program itself, some of the program's setup code could be replaced by a memcpy of a cached result.

Potential drawbacks:

  • Excess CPU and memory use from cacheing unused results.
  • The cache creates a security hole.
  • Excessive complication potentially leading to net slowdowns in operation.

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting
Page generated Feb. 12th, 2026 03:57 pm
Powered by Dreamwidth Studios