keySeq vs toList

Benchmark created on


Preparation HTML

<script src="immutable.min.js"></script>

Setup

const data = (() => {
	let map = Immutable.Map()
	for(var i = 0; i <= 100000; i++) {
	    map = map.put(`key${i}`, Math.random())
	}
	
	return map
})()

Test runner

Ready to run.

Testing in
TestOps/sec
Key Seq
data.keySeq().map((key) => ({ key, value: data.get(key) }))
ready
toList
data.map((value, key) => ({ key, value })).toList()
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.