http://jsperf.com/invert-vs-map which should be used for this case?