Performance
The performance of solutions built with Worklight can be improved via a number of different
techniques.
Minification
When a Worklight solution containing JavaScript and CSS is built, part of the "cost" of executing
that solution may be the size of the source files containing this data. Since JavaScript is not a
compiled language but is rather an interpreted language, the JavaScript source file must be
transmitted and parsed in order to run. This can mean that content that is necessary for human
consumption such as comments and white space have to be loaded and examined.
Minification is the notion that a source file can be transformed from one set of content to another
without losing any of its semantic content. This can mean the removal of comments, the removal of
white space and the renaming of long variable names to ones which are much shorter. The result is
a new source file which is basically un-intelligible to a human but can result in decreased load times
and more efficient execution.
Worklight supports minification with three options:
• none – No minification is performed.
• whitespaces – Only comments and whitespace are transformed.
• simple – Whitespace is transformed as well as variable name replacement.
The Worklight implementation of minification utilizes the "Google Closure Compiler". This Open
Source tool from Google, despite its name, is not a compiler but rather provides a transformation
from human edited JavaScript to a minified representation.
The minification options can be found in the build settings of the project.
The level specifies the minification level, they are:
• None (Default)
Page 92
Comentários a estes Manuais