Skip to content

Commit

Permalink
Moar runs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Oct 1, 2017
1 parent ba91f0c commit 00133bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const createTimestamp = () => {
module.exports = (createLRU, num = 1000) => {
const lru = createLRU(num)

//set
// set
let setTimestamp = createTimestamp()
for(let i = 0; i < num; i++) lru.set(i, Math.random())
setTimestamp = setTimestamp()
Expand All @@ -18,7 +18,7 @@ module.exports = (createLRU, num = 1000) => {
for(let i = 0; i < num; i++) lru.get(i)
getTimestamp = getTimestamp()

//update
// update
let updateTimestmap = createTimestamp()
for(let i = 0; i < num; i++) lru.set(i, Math.random())
updateTimestmap = updateTimestmap()
Expand All @@ -28,7 +28,7 @@ module.exports = (createLRU, num = 1000) => {
for(let i = 0; i < num; i++) lru.get(i)
getTimestampTwo = getTimestampTwo()

//evict
// evict
let evictTimestamp = createTimestamp()
const evicts = num*2
for(let i = num; i < evicts; i++) lru.set(i, Math.random())
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const Simple = require('simple-lru-cache')
const Fast = require('lru-fast').LRUCache
const QuickLRU = require('quick-lru')
const Modern = require('modern-lru')
const hyperlru = require('hyperlru')
const MKC = require('mkc')

const lrus = {
Expand All @@ -23,13 +24,12 @@ const lrus = {
'tiny-lru': require('tiny-lru'),
hashlru: require('hashlru'),
hyperlru: max => hyperlru({max}),
hyperlru: require('hyperlru'),
lru_cache: n => new LRU_Cache(n),
lru: require('lru'),
mkc: max => new MKC({max}),
}

const N = 100000
const N = 200000
const headers = [
'name',
'set',
Expand Down

0 comments on commit 00133bd

Please sign in to comment.