Posts Tagged ‘FOR SCIENCE’

Quick JS experiment: Function Overhead

Wednesday, November 3rd, 2010

Probably common knowledge, but I just slapped together a quick test script to determine what kind of overhead there is between a) writing a function inline, b) keeping the function as part of an object (say, utility.isObject), and c) same as b, but get a reference to the function first. Each approach was iterated a total of 100,000,000 times to get usable time values. Tests were performed in Chrome 7, so YMMV. (more…)