From 7a5fc23e8f22bb3bd1f1206ff73db00b9302b1e2 Mon Sep 17 00:00:00 2001
From: "kschimpf@google.com"
create_nmf.py
tool helps generate an .nmf
file, but .nmf
files can also be written by hand.
+Size compression is an optional step for deployment, and reduces the
+size of the pexe file that must be transmitted over the wire. The tool
+pnacl-compress
applies compression strategies that are already built
+into the stable binary format of a pexe application. As such,
+compressed pexe files do not need any extra time to be decompressed on
+the client’s side. All costs are upfront when you call pnacl-compress
.
Currently, this tool will compress pexe files by about 25%. However, +it is somewhat slow (can take from seconds to minutes on large +appications). Hence, this step is optional.
++<NACL_SDK_ROOT>/toolchain/win_pnacl/bin/pnacl-compress ^ + hello_world.final.pexe ++
Tool pnacl-compress
must be called after a pexe file has been finalized
+for deployment (via pnacl-finalize
). Alternatively, you can apply this
+step as part of the finalizing step by adding the --compress
flag
+to the pnacl-finalize command line.
Note that this compression step doesn’t replace gzip. This compression +step is in addition to gzipping a file for deployment. One should note +that while the gzipped version of a compressed pexe file is still +smaller than the corresponding uncompressed pexe file, the gains is +somewhat smaller after being gzipped. Expected reduction in size +(after being gzipped) is more like 7.5% to 10%.
Besides the PNaCl toolchain, the Native Client SDK also includes modified
diff --git a/native_client_sdk/src/doc/devguide/devcycle/building.rst b/native_client_sdk/src/doc/devguide/devcycle/building.rst
index 3344293..3a63099 100644
--- a/native_client_sdk/src/doc/devguide/devcycle/building.rst
+++ b/native_client_sdk/src/doc/devguide/devcycle/building.rst
@@ -161,6 +161,8 @@ pnacl-clang
C compiler and compiler driver
pnacl-clang++
C++ compiler and compiler driver
+pnacl-compress
+ Size compresses a finalized **pexe** file for deployment.
pnacl-dis
Disassembler for both **pexe** files and **nexe** files
pnacl-finalize
@@ -324,6 +326,39 @@ The ``create_nmf.py`` tool helps generate an ``.nmf`` file, but ``.nmf``
files can also be written by hand.
+
+Compressing the **pexe** for deployment
+---------------------------------------
+
+Size compression is an optional step for deployment, and reduces the
+size of the pexe file that must be transmitted over the wire. The tool
+``pnacl-compress`` applies compression strategies that are already built
+into the **stable** binary format of a pexe application. As such,
+compressed pexe files do not need any extra time to be decompressed on
+the client's side. All costs are upfront when you call ``pnacl-compress``.
+
+Currently, this tool will compress pexe files by about 25%. However,
+it is somewhat slow (can take from seconds to minutes on large
+appications). Hence, this step is optional.
+
+.. naclcode::
+ :prettyprint: 0
+
+