Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hashlru

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hashlru - npm Package Compare versions

Comparing version 0.0.0 to 1.0.0

10

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc