elm-lang/Elm — pull request #578 by Xashili (2014-04-08 13:51:41+00:00)
Title: Add native fromList and initialize

fromList allocates M length arrays to write from the List and then pushes the nodes upwards.
Allocating (and eventually slicing if there were less items to write then M) gets faster at around 30 elements, but pushing (but therefor copying the whole array every time) is way faster for less elements, see http://jsperf.com/alloc-block-vs-pushing
This is convenient, as M is currently 32. So in the end, fromList is optimized for between 32 and 32*32 = 1024 elements. When there is a proper perfomance testing system, this behavior can get checked again.