Comparing version 0.0.0 to 1.0.0
{ | ||
"name": "hashlru", | ||
"description": "", | ||
"version": "0.0.0", | ||
"version": "1.0.0", | ||
"homepage": "https://github.com/dominictarr/hashlru", | ||
@@ -10,6 +10,4 @@ "repository": { | ||
}, | ||
"dependencies": { | ||
}, | ||
"devDependencies": { | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": {}, | ||
"scripts": { | ||
@@ -19,3 +17,3 @@ "test": "set -e; for t in test/*.js; do node $t; done" | ||
"author": "'Dominic Tarr' <dominic.tarr@gmail.com> (dominictarr.com)", | ||
"license": "MIT" | ||
"license": "MIT" | ||
} |
@@ -34,2 +34,5 @@ # hashlru | ||
see a [benchmark](https://github.com/dominictarr/bench-lru) of this against | ||
the other LRU implementations on npm. | ||
## example | ||
@@ -57,2 +60,14 @@ | ||
## complexity | ||
Writes are O(1) on average, like a hash table. | ||
When implemented in a garbage collected language, the old cache is thrown away when the new cache is | ||
full. To better manage memory usage, it could also be implemented as two fixes sized hash tables. | ||
In this case, instead of discarding the old cache, it would be zeroed. This means at most every N | ||
writes when the caches are rotated, that write will require N operations (to clear the old cache) | ||
This still averages out to O(1) but it does cost O(N) but only every N writes (except for updates) | ||
so N/N is still 1. | ||
## HashLRU (max) => lru | ||
@@ -59,0 +74,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
5732
0
87