Companion material for a post on lazutkin.com. Three questions, one file each (variants in a file differ in exactly one respect):
q1-create.js— building a four-field object, bare vs.Object.freeze()on the fresh object.q2b-read-many.js— reading four fields, plain vs. frozen, over 1,000 distinct objects.q3b-call-many.js— calling a prototype method, plain vs. frozen, over 1,000 distinct objects.
q2-read.js and q3-call.js are the first attempts over a single constant object. They measured 528 ps for both variants, about one CPU cycle: V8 hoisted the loop-invariant reads and left one addition per iteration. Kept as the cautionary example; the -many files replace them.