▍1. Optimized-JS-V8
面向对象、设计模式与性能 有些C/C++开发者有些奇怪的观念。他们认为使用面向对象和设计模式会降低程序的性能。但V8证明了这种观念是错误的。V8的实现使用了许多设计模式,但依然非常高效。 下面列出V8中使用的两个模式: 工厂模式 当Javascript引擎执行一个脚本时,引擎为遇到的每个变量、函数或数组都创建一个实例。JSObject是所有这些对象的父对象(Object oriented, design patterns and performance Some C/C++ developers have some strange ideas. They believe that the use of object-oriented and design patterns will reduce the performance of the program. But V8 proved that this idea is wrong. V8 implementation uses a number of design patterns, but still very efficient. The following lists the two models used in V8: Factory mode When a Javascript engine s a script, the engine creates an instance of each variable, function, or array encountered by the engine. JSObject is the parent of all of these objects.)