Comparing version 0.0.96 to 0.0.97
@@ -1,2 +0,2 @@ | ||
/*! dw-cache v0.0.96 https://github.com/falsandtru/dw-cache | (c) 2021, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! dw-cache v0.0.97 https://github.com/falsandtru/dw-cache | (c) 2021, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
@@ -519,5 +519,5 @@ if(typeof exports === 'object' && typeof module === 'object') | ||
} | ||
if (LRU.length >= this.window && this.overlapLRU * 100 / (0, alias_1.min)(LFU.length, this.partition) < this.sample) { | ||
if (this.injection === 100 && LRU.length >= this.window && this.overlapLRU * 100 / (0, alias_1.min)(LFU.length, this.partition) < this.sample) { | ||
const entry = LRU.head.prev; | ||
if (this.injection === 100 && entry.region === 'LRU') { | ||
if (entry.region === 'LRU') { | ||
LRU.delete(entry); | ||
@@ -580,3 +580,3 @@ LFU.unshift(this.overlap(entry)); | ||
} else { | ||
const delta = LFU.length < LRU.length ? LRU.length / LFU.length | 0 || LRU.length : 1; | ||
const delta = LRU.length > LFU.length && LRU.length >= this.capacity - this.partition ? LRU.length / LFU.length | 0 || LRU.length : 1; | ||
this.partition = (0, alias_1.min)(this.partition + delta, this.capacity - this.window); | ||
@@ -592,3 +592,3 @@ --this.overlapLFU; | ||
if (entry.region === 'LFU') {} else { | ||
const delta = LRU.length < LFU.length ? LFU.length / LRU.length | 0 || LFU.length : 1; | ||
const delta = LFU.length > LRU.length && LFU.length >= this.partition ? LFU.length / LRU.length | 0 || LFU.length : 1; | ||
this.partition = (0, alias_1.max)(this.partition - delta, 0); | ||
@@ -595,0 +595,0 @@ entry.region = 'LFU'; |
{ | ||
"name": "dw-cache", | ||
"version": "0.0.96", | ||
"version": "0.0.97", | ||
"description": "The highest performance constant complexity cache algorithm.", | ||
@@ -52,4 +52,4 @@ "private": false, | ||
"mocha": "^10.2.0", | ||
"npm-check-updates": "^16.5.6", | ||
"spica": "0.0.712", | ||
"npm-check-updates": "^16.6.0", | ||
"spica": "0.0.713", | ||
"ts-loader": "^9.4.2", | ||
@@ -56,0 +56,0 @@ "typescript": "4.9.4", |
174
README.md
@@ -202,3 +202,3 @@ # Dual Window Cache | ||
label: 'DWC', | ||
data: [11.73, 27.89, 38.66, 44.17, 50.52, 56.70, 59.14, 66.45], | ||
data: [11.75, 28.08, 39.00, 44.62, 51.01, 57.01, 59.21, 66.41], | ||
borderColor: Utils.color(2), | ||
@@ -225,3 +225,3 @@ }, | ||
 | ||
 | ||
@@ -231,4 +231,4 @@ ``` | ||
LRU hit ratio 3.08% | ||
DWC hit ratio 11.73% | ||
DWC - LRU hit ratio delta 8.64% | ||
DWC hit ratio 11.75% | ||
DWC - LRU hit ratio delta 8.66% | ||
DWC / LRU hit ratio rate 380% | ||
@@ -238,28 +238,28 @@ | ||
LRU hit ratio 10.74% | ||
DWC hit ratio 27.89% | ||
DWC - LRU hit ratio delta 17.15% | ||
DWC / LRU hit ratio rate 259% | ||
DWC hit ratio 28.08% | ||
DWC - LRU hit ratio delta 17.33% | ||
DWC / LRU hit ratio rate 261% | ||
DS1 3,000,000 | ||
LRU hit ratio 18.59% | ||
DWC hit ratio 38.66% | ||
DWC - LRU hit ratio delta 20.07% | ||
DWC / LRU hit ratio rate 207% | ||
DWC hit ratio 39.00% | ||
DWC - LRU hit ratio delta 20.41% | ||
DWC / LRU hit ratio rate 209% | ||
DS1 4,000,000 | ||
LRU hit ratio 20.24% | ||
DWC hit ratio 44.17% | ||
DWC - LRU hit ratio delta 23.92% | ||
DWC / LRU hit ratio rate 218% | ||
DWC hit ratio 44.62% | ||
DWC - LRU hit ratio delta 24.37% | ||
DWC / LRU hit ratio rate 220% | ||
DS1 5,000,000 | ||
LRU hit ratio 21.03% | ||
DWC hit ratio 50.52% | ||
DWC - LRU hit ratio delta 29.49% | ||
DWC / LRU hit ratio rate 240% | ||
DWC hit ratio 51.01% | ||
DWC - LRU hit ratio delta 29.97% | ||
DWC / LRU hit ratio rate 242% | ||
DS1 6,000,000 | ||
LRU hit ratio 33.95% | ||
DWC hit ratio 56.70% | ||
DWC - LRU hit ratio delta 22.74% | ||
DWC hit ratio 57.01% | ||
DWC - LRU hit ratio delta 23.05% | ||
DWC / LRU hit ratio rate 167% | ||
@@ -269,4 +269,4 @@ | ||
LRU hit ratio 38.89% | ||
DWC hit ratio 59.14% | ||
DWC - LRU hit ratio delta 20.24% | ||
DWC hit ratio 59.21% | ||
DWC - LRU hit ratio delta 20.31% | ||
DWC / LRU hit ratio rate 152% | ||
@@ -276,4 +276,4 @@ | ||
LRU hit ratio 43.03% | ||
DWC hit ratio 66.45% | ||
DWC - LRU hit ratio delta 23.42% | ||
DWC hit ratio 66.41% | ||
DWC - LRU hit ratio delta 23.37% | ||
DWC / LRU hit ratio rate 154% | ||
@@ -308,3 +308,3 @@ ``` | ||
label: 'DWC', | ||
data: [10.19, 18.68, 25.01, 30.44, 38.04, 46.63, 55.20, 63.43], | ||
data: [10.35, 18.94, 25.06, 30.42, 38.05, 46.81, 55.70, 64.03], | ||
borderColor: Utils.color(2), | ||
@@ -331,3 +331,3 @@ }, | ||
 | ||
 | ||
@@ -337,22 +337,22 @@ ``` | ||
LRU hit ratio 2.32% | ||
DWC hit ratio 10.19% | ||
DWC - LRU hit ratio delta 7.87% | ||
DWC / LRU hit ratio rate 438% | ||
DWC hit ratio 10.35% | ||
DWC - LRU hit ratio delta 8.03% | ||
DWC / LRU hit ratio rate 445% | ||
S3 200,000 | ||
LRU hit ratio 4.63% | ||
DWC hit ratio 18.68% | ||
DWC - LRU hit ratio delta 14.05% | ||
DWC / LRU hit ratio rate 403% | ||
DWC hit ratio 18.94% | ||
DWC - LRU hit ratio delta 14.30% | ||
DWC / LRU hit ratio rate 408% | ||
S3 300,000 | ||
LRU hit ratio 7.58% | ||
DWC hit ratio 25.01% | ||
DWC - LRU hit ratio delta 17.42% | ||
DWC / LRU hit ratio rate 329% | ||
DWC hit ratio 25.06% | ||
DWC - LRU hit ratio delta 17.47% | ||
DWC / LRU hit ratio rate 330% | ||
S3 400,000 | ||
LRU hit ratio 12.03% | ||
DWC hit ratio 30.44% | ||
DWC - LRU hit ratio delta 18.40% | ||
DWC hit ratio 30.42% | ||
DWC - LRU hit ratio delta 18.38% | ||
DWC / LRU hit ratio rate 252% | ||
@@ -362,4 +362,4 @@ | ||
LRU hit ratio 22.76% | ||
DWC hit ratio 38.04% | ||
DWC - LRU hit ratio delta 15.27% | ||
DWC hit ratio 38.05% | ||
DWC - LRU hit ratio delta 15.28% | ||
DWC / LRU hit ratio rate 167% | ||
@@ -369,17 +369,17 @@ | ||
LRU hit ratio 34.63% | ||
DWC hit ratio 46.63% | ||
DWC - LRU hit ratio delta 12.00% | ||
DWC / LRU hit ratio rate 134% | ||
DWC hit ratio 46.81% | ||
DWC - LRU hit ratio delta 12.18% | ||
DWC / LRU hit ratio rate 135% | ||
S3 700,000 | ||
LRU hit ratio 46.04% | ||
DWC hit ratio 55.20% | ||
DWC - LRU hit ratio delta 9.15% | ||
DWC / LRU hit ratio rate 119% | ||
DWC hit ratio 55.70% | ||
DWC - LRU hit ratio delta 9.66% | ||
DWC / LRU hit ratio rate 120% | ||
S3 800,000 | ||
LRU hit ratio 56.59% | ||
DWC hit ratio 63.43% | ||
DWC - LRU hit ratio delta 6.83% | ||
DWC / LRU hit ratio rate 112% | ||
DWC hit ratio 64.03% | ||
DWC - LRU hit ratio delta 7.43% | ||
DWC / LRU hit ratio rate 113% | ||
``` | ||
@@ -413,3 +413,3 @@ | ||
label: 'DWC', | ||
data: [19.15, 28.59, 33.79, 37.47, 39.60, 41.63, 43.14, 44.33], | ||
data: [19.07, 28.59, 33.82, 37.46, 39.73, 41.43, 43.04, 44.14], | ||
borderColor: Utils.color(2), | ||
@@ -436,3 +436,3 @@ }, | ||
 | ||
 | ||
@@ -442,5 +442,5 @@ ``` | ||
LRU hit ratio 16.47% | ||
DWC hit ratio 19.15% | ||
DWC - LRU hit ratio delta 2.68% | ||
DWC / LRU hit ratio rate 116% | ||
DWC hit ratio 19.07% | ||
DWC - LRU hit ratio delta 2.60% | ||
DWC / LRU hit ratio rate 115% | ||
@@ -455,4 +455,4 @@ OLTP 500 | ||
LRU hit ratio 28.28% | ||
DWC hit ratio 33.79% | ||
DWC - LRU hit ratio delta 5.51% | ||
DWC hit ratio 33.82% | ||
DWC - LRU hit ratio delta 5.54% | ||
DWC / LRU hit ratio rate 119% | ||
@@ -462,4 +462,4 @@ | ||
LRU hit ratio 32.83% | ||
DWC hit ratio 37.47% | ||
DWC - LRU hit ratio delta 4.64% | ||
DWC hit ratio 37.46% | ||
DWC - LRU hit ratio delta 4.63% | ||
DWC / LRU hit ratio rate 114% | ||
@@ -469,4 +469,4 @@ | ||
LRU hit ratio 36.20% | ||
DWC hit ratio 39.60% | ||
DWC - LRU hit ratio delta 3.39% | ||
DWC hit ratio 39.73% | ||
DWC - LRU hit ratio delta 3.52% | ||
DWC / LRU hit ratio rate 109% | ||
@@ -476,4 +476,4 @@ | ||
LRU hit ratio 38.69% | ||
DWC hit ratio 41.63% | ||
DWC - LRU hit ratio delta 2.93% | ||
DWC hit ratio 41.43% | ||
DWC - LRU hit ratio delta 2.74% | ||
DWC / LRU hit ratio rate 107% | ||
@@ -483,4 +483,4 @@ | ||
LRU hit ratio 40.78% | ||
DWC hit ratio 43.14% | ||
DWC - LRU hit ratio delta 2.36% | ||
DWC hit ratio 43.04% | ||
DWC - LRU hit ratio delta 2.25% | ||
DWC / LRU hit ratio rate 105% | ||
@@ -490,5 +490,5 @@ | ||
LRU hit ratio 42.46% | ||
DWC hit ratio 44.33% | ||
DWC - LRU hit ratio delta 1.86% | ||
DWC / LRU hit ratio rate 104% | ||
DWC hit ratio 44.14% | ||
DWC - LRU hit ratio delta 1.67% | ||
DWC / LRU hit ratio rate 103% | ||
``` | ||
@@ -522,3 +522,3 @@ | ||
label: 'DWC', | ||
data: [16.00, 32.51, 41.43, 49.91, 52.74, 53.78, 55.66, 57.96], | ||
data: [16.14, 32.52, 41.47, 49.86, 52.74, 53.77, 55.66, 57.96], | ||
borderColor: Utils.color(2), | ||
@@ -545,3 +545,3 @@ }, | ||
 | ||
 | ||
@@ -551,22 +551,22 @@ ``` | ||
LRU hit ratio 0.93% | ||
DWC hit ratio 16.00% | ||
DWC - LRU hit ratio delta 15.07% | ||
DWC / LRU hit ratio rate 1719% | ||
DWC hit ratio 16.14% | ||
DWC - LRU hit ratio delta 15.20% | ||
DWC / LRU hit ratio rate 1733% | ||
GLI 500 | ||
LRU hit ratio 0.96% | ||
DWC hit ratio 32.51% | ||
DWC - LRU hit ratio delta 31.54% | ||
DWC / LRU hit ratio rate 3372% | ||
DWC hit ratio 32.52% | ||
DWC - LRU hit ratio delta 31.56% | ||
DWC / LRU hit ratio rate 3374% | ||
GLI 750 | ||
LRU hit ratio 1.16% | ||
DWC hit ratio 41.43% | ||
DWC - LRU hit ratio delta 40.27% | ||
DWC / LRU hit ratio rate 3561% | ||
DWC hit ratio 41.47% | ||
DWC - LRU hit ratio delta 40.30% | ||
DWC / LRU hit ratio rate 3564% | ||
GLI 1,000 | ||
LRU hit ratio 11.22% | ||
DWC hit ratio 49.91% | ||
DWC - LRU hit ratio delta 38.69% | ||
DWC hit ratio 49.86% | ||
DWC - LRU hit ratio delta 38.64% | ||
DWC / LRU hit ratio rate 444% | ||
@@ -582,4 +582,4 @@ | ||
LRU hit ratio 36.56% | ||
DWC hit ratio 53.78% | ||
DWC - LRU hit ratio delta 17.22% | ||
DWC hit ratio 53.77% | ||
DWC - LRU hit ratio delta 17.20% | ||
DWC / LRU hit ratio rate 147% | ||
@@ -605,4 +605,4 @@ | ||
LRU hit ratio 0.00% | ||
DWC hit ratio 7.71% | ||
DWC - LRU hit ratio delta 7.71% | ||
DWC hit ratio 7.83% | ||
DWC - LRU hit ratio delta 7.83% | ||
DWC / LRU hit ratio rate Infinity% | ||
@@ -612,4 +612,4 @@ | ||
LRU hit ratio 0.00% | ||
DWC hit ratio 20.49% | ||
DWC - LRU hit ratio delta 20.49% | ||
DWC hit ratio 20.41% | ||
DWC - LRU hit ratio delta 20.41% | ||
DWC / LRU hit ratio rate Infinity% | ||
@@ -619,4 +619,4 @@ | ||
LRU hit ratio 0.00% | ||
DWC hit ratio 40.98% | ||
DWC - LRU hit ratio delta 40.98% | ||
DWC hit ratio 41.34% | ||
DWC - LRU hit ratio delta 41.34% | ||
DWC / LRU hit ratio rate Infinity% | ||
@@ -626,4 +626,4 @@ | ||
LRU hit ratio 0.00% | ||
DWC hit ratio 67.44% | ||
DWC - LRU hit ratio delta 67.44% | ||
DWC hit ratio 67.94% | ||
DWC - LRU hit ratio delta 67.94% | ||
DWC / LRU hit ratio rate Infinity% | ||
@@ -630,0 +630,0 @@ |
108837