Comparing version 0.0.723 to 0.0.724
@@ -445,3 +445,3 @@ import { Cache } from './cache'; | ||
console.debug('DWC overlap', dwc['overlapLRU'], dwc['overlapLFU']); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 173); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 174); | ||
}); | ||
@@ -535,3 +535,3 @@ | ||
console.debug('DWC overlap', dwc['overlapLRU'], dwc['overlapLFU']); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 67); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 66); | ||
}); | ||
@@ -562,3 +562,3 @@ | ||
assert(stats.dwc / stats.lru * 100 === Infinity); | ||
assert(stats.dwc * 100 / trials >>> 0 === 42); | ||
assert(stats.dwc * 100 / trials >>> 0 === 41); | ||
}); | ||
@@ -631,3 +631,3 @@ | ||
assert(stats.dwc / stats.lru * 100 === Infinity); | ||
assert(stats.dwc * 100 / capacity >>> 0 === 8); | ||
assert(stats.dwc * 100 / capacity >>> 0 === 29); | ||
}); | ||
@@ -675,4 +675,4 @@ | ||
console.debug('DWC overlap', dwc['overlapLRU'], dwc['overlapLFU']); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 79); | ||
assert(dwc['LFU'].length * 100 / capacity >>> 0 === 88); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 83); | ||
assert(dwc['LFU'].length * 100 / capacity >>> 0 === 84); | ||
}); | ||
@@ -720,4 +720,4 @@ | ||
console.debug('DWC overlap', dwc['overlapLRU'], dwc['overlapLFU']); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 37); | ||
assert(dwc['LFU'].length * 100 / capacity >>> 0 === 76); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 39); | ||
assert(dwc['LFU'].length * 100 / capacity >>> 0 === 90); | ||
}); | ||
@@ -750,3 +750,3 @@ | ||
console.debug('DWC overlap', dwc['overlapLRU'], dwc['overlapLFU']); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 168); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 167); | ||
}); | ||
@@ -753,0 +753,0 @@ |
@@ -203,3 +203,3 @@ import { max, min, floor, round } from './alias'; | ||
threshold: 10, | ||
ratio: 50, | ||
ratio: 25, | ||
window: 2, | ||
@@ -607,5 +607,3 @@ room: 50, | ||
this.threshold *= 100; | ||
this.window = round(capacity * window / 100) || 1; | ||
this.room = round(capacity * room / 100) || 1; | ||
this.range = capacity * range / 100; | ||
this.resize(capacity, window, room, range); | ||
} | ||
@@ -612,0 +610,0 @@ private currWindowHits = 0; |
{ | ||
"name": "spica", | ||
"version": "0.0.723", | ||
"version": "0.0.724", | ||
"description": "Supervisor, Coroutine, Channel, select, AtomicPromise, Cancellation, Cache, List, Queue, Stack, and some utils.", | ||
@@ -5,0 +5,0 @@ "private": false, |
@@ -445,3 +445,3 @@ import { Cache } from './cache'; | ||
console.debug('DWC overlap', dwc['overlapLRU'], dwc['overlapLFU']); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 173); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 174); | ||
}); | ||
@@ -535,3 +535,3 @@ | ||
console.debug('DWC overlap', dwc['overlapLRU'], dwc['overlapLFU']); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 67); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 66); | ||
}); | ||
@@ -562,3 +562,3 @@ | ||
assert(stats.dwc / stats.lru * 100 === Infinity); | ||
assert(stats.dwc * 100 / trials >>> 0 === 42); | ||
assert(stats.dwc * 100 / trials >>> 0 === 41); | ||
}); | ||
@@ -631,3 +631,3 @@ | ||
assert(stats.dwc / stats.lru * 100 === Infinity); | ||
assert(stats.dwc * 100 / capacity >>> 0 === 8); | ||
assert(stats.dwc * 100 / capacity >>> 0 === 29); | ||
}); | ||
@@ -675,4 +675,4 @@ | ||
console.debug('DWC overlap', dwc['overlapLRU'], dwc['overlapLFU']); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 79); | ||
assert(dwc['LFU'].length * 100 / capacity >>> 0 === 88); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 83); | ||
assert(dwc['LFU'].length * 100 / capacity >>> 0 === 84); | ||
}); | ||
@@ -720,4 +720,4 @@ | ||
console.debug('DWC overlap', dwc['overlapLRU'], dwc['overlapLFU']); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 37); | ||
assert(dwc['LFU'].length * 100 / capacity >>> 0 === 76); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 39); | ||
assert(dwc['LFU'].length * 100 / capacity >>> 0 === 90); | ||
}); | ||
@@ -750,3 +750,3 @@ | ||
console.debug('DWC overlap', dwc['overlapLRU'], dwc['overlapLFU']); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 168); | ||
assert(stats.dwc / stats.lru * 100 >>> 0 === 167); | ||
}); | ||
@@ -753,0 +753,0 @@ |
@@ -203,3 +203,3 @@ import { max, min, floor, round } from './alias'; | ||
threshold: 10, | ||
ratio: 50, | ||
ratio: 25, | ||
window: 2, | ||
@@ -607,5 +607,3 @@ room: 50, | ||
this.threshold *= 100; | ||
this.window = round(capacity * window / 100) || 1; | ||
this.room = round(capacity * room / 100) || 1; | ||
this.range = capacity * range / 100; | ||
this.resize(capacity, window, room, range); | ||
} | ||
@@ -612,0 +610,0 @@ private currWindowHits = 0; |
1153516
32260