From 7a5fc23e8f22bb3bd1f1206ff73db00b9302b1e2 Mon Sep 17 00:00:00 2001 From: "kschimpf@google.com" Date: Mon, 3 Mar 2014 17:24:15 +0000 Subject: Add section on compressing pexe files for deployment. BUG=None R=binji@chromium.org, jfb@chromium.org, jvoung@chromium.org Review URL: https://codereview.chromium.org/177533025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254489 0039d316-1c4b-4281-b951-d872f2087c98 --- .../doc_generated/devguide/devcycle/building.html | 48 +++++++++++++++++----- .../src/doc/devguide/devcycle/building.rst | 35 ++++++++++++++++ 2 files changed, 73 insertions(+), 10 deletions(-) diff --git a/native_client_sdk/doc_generated/devguide/devcycle/building.html b/native_client_sdk/doc_generated/devguide/devcycle/building.html index 9431767..3737c05 100644 --- a/native_client_sdk/doc_generated/devguide/devcycle/building.html +++ b/native_client_sdk/doc_generated/devguide/devcycle/building.html @@ -21,22 +21,23 @@
  • Create a static library
  • Link the application
  • Finalizing the pexe for deployment
  • +
  • Compressing the pexe for deployment
  • -
  • The GNU-based toolchains

    +
  • The GNU-based toolchains

  • -
  • Using make
  • -
  • Libraries and header files provided with the SDK
  • -
  • Troubleshooting

    +
  • Using make
  • +
  • Libraries and header files provided with the SDK
  • +
  • Troubleshooting

  • @@ -159,6 +160,8 @@ tools include:

    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
    @@ -286,6 +289,31 @@ stripping out debug information and other metadata.

    refer to the final version of the application before deployment. 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.

    +
    +<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%.

    The GNU-based toolchains

    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 + + /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%. + The GNU-based toolchains ======================== -- cgit v1.1