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

persistent-hash-trie

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

persistent-hash-trie - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

14

benchmark/assoc.js

@@ -6,2 +6,3 @@ 'use strict'

var versions = require('./versions')
var mori = require('mori')

@@ -12,3 +13,3 @@ var makeSuite = function(quantity){

var test = function(o){
var addTest = function(o){
var name = o.name

@@ -26,4 +27,13 @@ var p = o.module

_.each(versions, test)
_.each(versions, addTest)
// mori benchmark
var moriMap = _.reduce(keys, function(map, key){
return mori.assoc(map, key, true)
}, mori.hash_map())
suite.add('mori', function(){
mori.assoc(moriMap, 'key', 'val')
})
return suite

@@ -30,0 +40,0 @@ }

40

benchmark/benchmarks.js

@@ -36,26 +36,26 @@ 'use strict'

mutable(1),
mutable(10),
mutable(100),
mutable(1000),
// mutable(1),
// mutable(10),
// mutable(100),
// mutable(1000),
keys(1),
keys(10),
keys(100),
keys(1000)
// keys(1),
// keys(10),
// keys(100),
// keys(1000)
// hash(1),
// hash(3),
// hash(5),
// hash(10),
// hash(50),
// hash(100),
// hash(500),
// hash(1000),
// hash(5000),
// hash(10000),
// hash(50000),
// hash(100000)
// hash(1),
// hash(3),
// hash(5),
// hash(10),
// hash(50),
// hash(100),
// hash(500),
// hash(1000),
// hash(5000),
// hash(10000),
// hash(50000),
// hash(100000)
]
_.each(suites, run)

@@ -6,2 +6,3 @@ 'use strict'

var versions = require('./versions')
var mori = require('mori')

@@ -12,3 +13,3 @@ var makeSuite = function(quantity){

var test = function(o){
var addTest = function(o){
var name = o.name

@@ -28,4 +29,14 @@ var p = o.module

_.each(versions, test)
_.each(versions, addTest)
// mori benchmark
var moriMap = _.reduce(keys, function(map, key){
return mori.assoc(map, key, true)
}, mori.hash_map())
suite.add('mori', function(){
mori.dissoc(moriMap, 'key', 'val')
})
return suite

@@ -32,0 +43,0 @@ }

@@ -6,2 +6,3 @@ 'use strict'

var versions = require('./versions')
var mori = require('mori')

@@ -12,3 +13,3 @@ var makeSuite = function(quantity){

var test = function(o){
var addTest = function(o){
var name = o.name

@@ -27,3 +28,13 @@ var p = o.module

_.each(versions, test)
_.each(versions, addTest)
// mori benchmark
var moriMap = _.reduce(keys, function(map, key){
return mori.assoc(map, key, true)
}, mori.hash_map())
suite.add('mori', function(){
mori.get(moriMap, 'key', 'val')
})
return suite

@@ -30,0 +41,0 @@ }

@@ -6,3 +6,3 @@ 'use strict'

var versions = require('./versions')
var mori = require('mori')
var makeSuite = function(quantity){

@@ -28,2 +28,11 @@ var suite = new require('benchmark').Suite('has property with Trie of ' + quantity)

// mori benchmark
var moriMap = _.reduce(keys, function(map, key){
return mori.assoc(map, key, true)
}, mori.hash_map())
suite.add('mori', function(){
mori.has_key(moriMap, 'key', 'val')
})
return suite

@@ -30,0 +39,0 @@ }

{
"name": "persistent-hash-trie",
"description": "Pure string:val storage, using structural sharing",
"version": "0.4.1",
"version": "0.4.2",
"main": "src/persistent-hash-trie.js",

@@ -20,3 +20,4 @@ "scripts": {

"string-hash": "1.1.0",
"format-number": "0.0.0"
"format-number": "0.0.0",
"mori": "0.2.0"
},

@@ -23,0 +24,0 @@ "repository": {

Sorry, the diff of this file is not supported yet

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