// This program tests the performance of calling map[f,list] as opposed to // just calling the function repeatedly. a = makeArray[[million], 1] double[x] := x + x doubleFunc = getFunction["double", 1] for loop = 1 to 5 { results = new array start = now[] for item = a results.push[double[item]] end = now[] println["Call, no print: " + ((end-start) -> "ms")] start = now[] for item = a double[item] end = now[] println["Call, no push: " + ((end-start) -> "ms")] start = now[] results = map[doubleFunc, a] end = now[] println["Map: " + ((end-start) -> "ms")] println[] }