20180710

BlackScript

Valuable technique in JavaScript class coding: link

A benchmark.js test running on node.js indicates a performance improvement for bulk object creation:

Research>node bench.js
OldStyleClass x 165,772 ops/sec ±0.38% (106 runs sampled)
Ex Nihilo x 180,305 ops/sec ±0.50% (104 runs sampled)
Fastest is Ex Nihilo

Research>node bench.js
NewStyleClass x 163,242 ops/sec ±0.28% (111 runs sampled)
Ex Nihilo x 180,219 ops/sec ±0.46% (100 runs sampled)
Fastest is Ex Nihilo

Research>node bench.js
OldStyleClass x 160,930 ops/sec ±0.58% (103 runs sampled)
NewStyleClass x 161,634 ops/sec ±0.79% (105 runs sampled)
Ex Nihilo x 176,387 ops/sec ±0.44% (107 runs sampled)
Fastest is Ex Nihilo

Try this in your own browser here







Update 20200627: None of the newer versions of the browsers run Ex Nihilo faster. Optimization wins!

KVR News:

The Gadget Blog | Latest Gadgets, Technology