Open VladRodionov opened 1 year ago
This may require refactoring of index format as well.
Add
public double score(long ibPtr, long ptr, int index)
to IndexFormat.
Score is the positive real number. The lower the score - the higher the item priority. Examples of score functions
W-LFU with inverse weight: (currentTime - lastAccessTime) * inverseWeight / numberOfAccesses.
InverseWeight examples:
iw = size / cost - size of a cached item and cost of cold generation
Better score functions:
score = A T/(T1 N1)
This function preserves ordering between any pair of objects without hits as time goes by.
To support dynamically calculated promotion index. Currently, the API provides only current item index and total number of items in the index block. This won't allow complex eviction algorithms, such as window LFU or Dual Gready Size Frequency.