Skip to content

Commit

Permalink
Adds perf tests for Map.merge. (#1407)
Browse files Browse the repository at this point in the history
* Adds perf tests for `Map.merge` and `Map.mergeDeep`.

* Per review, updated descriptions, and test merges different Map instances (and content).

* Ensure merge has differing values during perf test

* Remove mergeDeep()

It wasn't actually running mergeDeep() and as a perf test, it's a thin composition atop merge() anyhow.
  • Loading branch information
abacaphiliac authored and leebyron committed Oct 18, 2017
1 parent d20c36b commit c151990
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions perf/Map.js
Expand Up @@ -123,4 +123,22 @@ describe('Map', function() {
Immutable.Map(list1024);
});
});

describe('merge a map', () => {
[2, 8, 32, 1024].forEach(size => {
const obj1 = {};
const obj2 = {};
for (let ii = 0; ii < size; ii++) {
obj1['k' + ii] = '1_' + ii;
obj2['k' + ii] = '2_' + ii;
}

const map1 = Immutable.Map(obj1);
const map2 = Immutable.Map(obj2);

it('of ' + size, () => {
map1.merge(map2);
});
});
});
});

0 comments on commit c151990

Please sign in to comment.