rem’s avatarrem’s Twitter Archive—№ 67,434

  1. There's some weird/surprising optimisations in V8 and sparse arrays. For example: it takes the same amount of time to new Array 1,000 as it does 1,000,000,000, which is 20,000 *faster* than new Array 10,000,000
    1. …in reply to @rem
      And iterating over a sparse array: map looks to get incrementally slower - sure, that makes sense, forEach, _much_ faster than map, until we jump to 100,000,000 wherein it takes ~25 *seconds* (up from 80ms on 10,000,000).