HTML and CSS Reference
Duncan Tebbs, Senior Software Engineer, Turbulenz Limited
Efficient use of system resources is essential to most game applications, to ensure that the game runs correctly and
as smoothly as possible across a range of devices and browsers. Here, the term “resources” can refer to available
impact upon resource usage.
Much of the information here is taken from the significant amount of research and engineering manpower
that the Turbulenz team has invested in high performance HTML5. As an open-source, proven engine that boasts
a portfolio including several fully playable 2D and 3D games, the Turbulenz engine ( turbulenz.com ) represents
a valuable resource for developers seeking to learn more about HTML5 and understand what is possible with
modern web technology.
For many experienced HTML5 engineers the material presented may need little or no explanation. However, the
authors hope this chapter will serve as an introduction for newcomers, and as a reference and explanation of some
fundamental optimization concepts.
As with all optimization, it is important to measure the effect of code and data changes on memory and execution
time. This is something of a universal mantra when writing and maintaining high-performance code, and it is even
rapidly as their developers continue to aggressively address the bottlenecks experienced by high performance
For this reason, it is highly recommended that developers measure performance over a range of target browser
and versions, and keep track of how new browser releases affect their code. As another consequence of the variety
and changing nature of browser performance characteristics, this article intentionally avoids mentioning specific
The Importance of Data Structures
dictionaries, with all of the (non-trivial) memory and execution overhead required to support this system.
reduce the cost of retrieving and storing data by name, and in many cases these can be highly effective. Particularly
in the case where the engine can correctly predict the “type” of object being dereferenced, the cost of storing and
retrieving data can be comparable to native code. Here “type” may refer to a set of known properties that make up