persistent-hash-trie icon indicating copy to clipboard operation
persistent-hash-trie copied to clipboard

dissoc removing other entries

Open mattbierner opened this issue 11 years ago • 0 comments

I know this project is not active, but I was benchmarking JS hashtrie implementations and I think dissoc has a bug:

var p = require('persistent-hash-trie');

var h = p.Trie();
var h1 = p.assoc(h, 'q', true);
var h2 = p.assoc(h1, 'gv', true);

// Remove other key.
var h3 = p.dissoc(h2, 'q');
console.log(p.has(h3, 'gv')); // false

My benchmarks results for removing all elements of a hashtrie showed this library to be 10x faster, while it was consistently slower for single removes and group puts. I believe this is the cause.

mattbierner avatar Feb 20 '14 21:02 mattbierner