-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathOptimize.html
More file actions
54 lines (50 loc) · 3.17 KB
/
Optimize.html
File metadata and controls
54 lines (50 loc) · 3.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Pyjs</title>
<link rel="stylesheet" type="text/css" media="screen" href="assets/main.css"/>
</head>
<body>
<div id="menu">
<div id="logo"><a href="./" title="Pyjs!"><img src="assets/images/pyjs.128x128.png" alt="Pyjs Logo" /></a></div>
<ul class="simple">
<li class="section">About</li>
<li><a class="reference external" href="About.html">About</a></li>
<li><a class="reference external" href="Overview.html">Overview</a></li>
<li><a class="reference external" href="Translator.html">Translator</a></li>
<li><a class="reference external" href="Download.html">Download</a></li>
<li><a class="reference external" href="GettingHelp.html">Getting Help</a></li>
<li class="section">Documentation</li>
<li><a class="reference external" href="examples">Examples</a></li>
<li><a class="reference external" href="UIHierarchy.html">UI Hierarchy</a></li>
<li><a class="reference external" href="api">API Docs</a></li>
<li><a class="reference external" href="book/Bookreader.html">Book</a></li>
<li><a class="reference external" href="https://github.com/pyjs/pyjs/wiki">Wiki</a></li>
<li class="section">Development</li>
<li><a class="reference external" href="Developing.html">Develop</a></li>
<li><a class="reference external" href="Optimize.html">Optimize</a></li>
<li><a class="reference external" href="Contribute.html">Contribute</a></li>
<li><a class="reference external" href="Roadmap.html">Roadmap</a></li>
</ul>
</div>
<div id="body">
<h1 class="title">Optimize</h1>
<p>JavaScript code generated by the pyjs compiler <tt class="docutils literal">pyjsbuild</tt> is relatively large, unobfuscated and uncompressed.</p>
<div class="section" id="reduce-size">
<h1>Reduce Size</h1>
<p>Take a look at the <tt class="docutils literal">pyjscompressor.py</tt> script in the <a class="reference external" href="https://github.com/pyjs/pyjs/blob/master/contrib">contrib folder</a>, which will do a great job in dramatically reducing the size of the generated JavaScript code.</p>
</div>
<div class="section" id="increase-speed">
<h1>Increase Speed</h1>
<p><tt class="docutils literal">pyjsbuild</tt> command line switch <tt class="docutils literal"><span class="pre">-O</span></tt>, <tt class="docutils literal"><span class="pre">--enable-speed</span></tt> optimizes JavaScript output for speed.</p>
<p>Improving responsiveness may be able using the <tt class="docutils literal"><span class="pre">--enable-strict</span> <span class="pre">--disable-debug</span> <span class="pre">--dynamic-link</span></tt> command line switches. This generates more files instead of copying modules into <tt class="docutils literal">*cache.html</tt> files.</p>
</div>
<div class="section" id="obfuscate">
<h1>Obfuscate</h1>
<p>Although there is no specific obfuscator provided for pyjs you can use any tool available for JavaScript code (e.g. see this <a class="reference external" href="http://stackoverflow.com/questions/194397/how-can-i-obfuscate-javascript">StackOverflow question</a>).</p>
</div>
</div>
</body>
</html>