"If you really want to have memory-pressure sensitive cache, encapsulate your preferred cache and add separate functionality which detects memory pressure with SoftReference instance just for that"
"Typical tuning options at the CPU level include: reduce the number of instructions needed to execute the algorithm; change the data structure to reduce memory stalls (waiting for memory); change the program logic to reduce branch stalls (eg from mispredicted branches); change the order of operations so that they execute in parallel across the cores more easily (if in a loop each subsequent operation depends on the result of the last one, this is difficult); breakdown long latency operations into multiple simpler ones"