mbostock/d3 — pull request #2064 by jfirebaugh (2014-10-14 01:22:40+00:00)
Title: Optimize selection.data(values, key)

Preallocate the keyValues array and use a single Map with the
sentinel value `true` to represent a previously seen key.

Before:

selection.data(values, key) (enter) 1.5ms/op.
selection.data(values, key) (update) 1.7ms/op.

After:

selection.data(values, key) (enter) 0.81ms/op.
selection.data(values, key) (update) 1.1ms/op.