OLD | NEW |
1 .. _faq: | 1 .. _faq: |
2 | 2 |
3 ########################## | 3 ########################## |
4 Frequently Asked Questions | 4 Frequently Asked Questions |
5 ########################## | 5 ########################## |
6 | 6 |
7 .. contents:: | 7 .. contents:: |
8 :local: | 8 :local: |
9 :backlinks: none | 9 :backlinks: none |
10 :depth: 2 | 10 :depth: 2 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 model which adapts to novel attacks, without affecting | 56 model which adapts to novel attacks, without affecting |
57 already-released applications. | 57 already-released applications. |
58 * **Convenience:** Developers only need to ship a single ``.pexe`` file, | 58 * **Convenience:** Developers only need to ship a single ``.pexe`` file, |
59 not one ``.nexe`` file per supported architecture. | 59 not one ``.nexe`` file per supported architecture. |
60 * **Portability:** Developers and users don't need to worry about | 60 * **Portability:** Developers and users don't need to worry about |
61 already-released applications not working on new hardware: PNaCl | 61 already-released applications not working on new hardware: PNaCl |
62 already supports all architectures NaCl does, and as PNaCl evolves it | 62 already supports all architectures NaCl does, and as PNaCl evolves it |
63 gains support for new processors and fully uses their capabilities. | 63 gains support for new processors and fully uses their capabilities. |
64 | 64 |
65 .. TODO Expand on the PNaCl performance section in another document, and | 65 .. TODO Expand on the PNaCl performance section in another document, and |
66 .. link to it here. | 66 .. link to it here. How does one profile PNaCl code? What are common |
| 67 .. causes of slowness? How can code be made faster? What's the best way |
| 68 .. to use Pepper's asynchronous APIs? What do I need to know about |
| 69 .. threads and inter-thread communications? Can I use SIMD or other |
| 70 .. processor-specific instructions? What aboutt he GPU? |
67 | 71 |
68 For more details, refer to the :doc:`history behind and comparison of | 72 For more details, refer to the :doc:`history behind and comparison of |
69 NaCl and PNaCl <nacl-and-pnacl>`. | 73 NaCl and PNaCl <nacl-and-pnacl>`. |
70 | 74 |
71 When should I use Native Client? | 75 When should I use Native Client? |
72 -------------------------------- | 76 -------------------------------- |
73 | 77 |
74 The following are some typical use cases. For details, see the | 78 The following are some typical use cases. For details, see the |
75 :doc:`Technical Overview <overview>`. | 79 :doc:`Technical Overview <overview>`. |
76 | 80 |
77 * Porting existing software components for use in a web application. | 81 * Porting existing software components for use in a web application. |
78 * Porting legacy desktop applications. | 82 * Porting legacy desktop applications. |
79 * Handling browser-side encryption and decryption for an enterprise | 83 * Handling browser-side encryption and decryption for an enterprise |
80 application. | 84 application. |
81 * Handling multimedia for a web application. | 85 * Handling multimedia for a web application. |
82 * Handling various aspects of web-based games, including physics engines | 86 * Handling various aspects of web-based games, including physics engines |
83 and AI. | 87 and AI. |
84 | 88 |
85 Native Client is a versatile technology; we expect that it will also be | 89 Native Client is a versatile technology; we expect that it will also be |
86 used in many other contexts outside of Chrome. | 90 used in many other contexts outside of Chrome. |
87 | 91 |
88 When should I use Portable Native Client? | 92 When should I use Portable Native Client? |
89 ----------------------------------------- | 93 ----------------------------------------- |
90 | 94 |
91 See :doc:`NaCl and PNaCl <nacl-and-pnacl>`. In short: PNaCl works on the | 95 See :doc:`NaCl and PNaCl <nacl-and-pnacl>`. In short: PNaCl works on the |
92 open web whereas NaCl only works on the Chrome Web Store. | 96 open web whereas NaCl only works on the Chrome Web Store. |
93 | 97 |
94 How fast does code run in Native Client? | 98 How fast does code run in Portable Native Client? |
95 ---------------------------------------- | 99 ------------------------------------------------- |
96 | 100 |
97 Fast! Benchmarks on x86-32 measured an average performance overhead of | 101 Fast! The SPEC2k benchmarks (C, C++ and floating-point benchmarks) give |
98 less than 5% compared to native C/C++ on applications such as Quake, | 102 the following overhead for optimized PNaCl compared to regular optimized |
99 bzip2, and Google Earth. For details of those benchmarks, see `Native | 103 LLVM: |
100 Client: A Sandbox for Portable, Untrusted x86 Code | |
101 <https://src.chromium.org/viewvc/native_client/data/docs_tarball/nacl/googleclie
nt/native_client/documentation/nacl_paper.pdf>`_ | |
102 (PDF). | |
103 | 104 |
104 Benchmarks on x86-64 and ARM measured an average performance overhead of | 105 +--------+-----+ |
105 less than 5% on ARM and 7% on x86-64; however, benchmark performance was | 106 | x86-32 | 15% | |
106 bimodal for x86-64, so different use cases are likely to achieve either | 107 +--------+-----+ |
107 significantly better or significantly worse performance than that | 108 | x86-64 | 20% | |
108 average. For details, see `Adapting Software Fault Isolation to | 109 +--------+-----+ |
109 Contemporary CPU Architectures | 110 | ARM | 10% | |
110 <https://nativeclient.googlecode.com/svn/data/site/NaCl_SFI.pdf>`_ (PDF). | 111 +--------+-----+ |
111 | 112 |
112 .. TODO Update performance numbers. | 113 Note that benchmark performance is sometimes bimodal, so different use |
| 114 cases are likely to achieve better or worse performance than the above |
| 115 averages. For example floating-point heavy code usually exhibits much |
| 116 lower overheads whereas very branch-heavy code often performs worse. |
| 117 |
| 118 For details, see: |
| 119 |
| 120 * `Adapting Software Fault Isolation to Contemporary CPU Architectures |
| 121 <https://nativeclient.googlecode.com/svn/data/site/NaCl_SFI.pdf>`_ |
| 122 (PDF). |
| 123 * `Native Client: A Sandbox for Portable, Untrusted x86 Code |
| 124 <https://src.chromium.org/viewvc/native_client/data/docs_tarball/nacl/googlecl
ient/native_client/documentation/nacl_paper.pdf>`_ |
| 125 (PDF). |
113 | 126 |
114 If your code isn't performing as close to native speed as you'd expect, | 127 If your code isn't performing as close to native speed as you'd expect, |
115 :doc:`let us know <help>`! | 128 :doc:`let us know <help>`! |
116 | 129 |
| 130 .. TODO Link to the non-existent performance page! (see above todo). |
| 131 |
117 Why use Portable Native Client instead of *<technology X>*? | 132 Why use Portable Native Client instead of *<technology X>*? |
118 ----------------------------------------------------------- | 133 ----------------------------------------------------------- |
119 | 134 |
120 Many other technologies can be compared to Portable Native Client: | 135 Many other technologies can be compared to Portable Native Client: |
121 Flash, Java, Silverlight, ActiveX, .NET, asm.js, etc... | 136 Flash, Java, Silverlight, ActiveX, .NET, asm.js, etc... |
122 | 137 |
123 Different technologies have different strengths and weaknesses. In | 138 Different technologies have different strengths and weaknesses. In |
124 appropriate contexts, Portable Native Client can be faster, more secure, | 139 appropriate contexts, Portable Native Client can be faster, more secure, |
125 and/or more compatible across operating systems and architectures than | 140 and/or more compatible across operating systems and architectures than |
126 other technologies. | 141 other technologies. |
(...skipping 17 matching lines...) Expand all Loading... |
144 ------------------------------------------------------------------------------- | 159 ------------------------------------------------------------------------------- |
145 | 160 |
146 You can develop on Windows, Mac, or Linux, and the resulting Native | 161 You can develop on Windows, Mac, or Linux, and the resulting Native |
147 Client or Portable Native Client application will run inside the Google | 162 Client or Portable Native Client application will run inside the Google |
148 Chrome browser on all those platforms as well as ChromeOS. You can also | 163 Chrome browser on all those platforms as well as ChromeOS. You can also |
149 develop on ChromeOS with `Crouton | 164 develop on ChromeOS with `Crouton |
150 <https://github.com/dnschneid/crouton>`_, and we're working on | 165 <https://github.com/dnschneid/crouton>`_, and we're working on |
151 self-hosting a full development environment on Portable Native Client. | 166 self-hosting a full development environment on Portable Native Client. |
152 | 167 |
153 Any editor+shell combination should work as well as IDEs like Eclipse, | 168 Any editor+shell combination should work as well as IDEs like Eclipse, |
154 Visual Studio with the `Native Client Add-In | 169 Visual Studio with the :doc:`Native Client Add-In |
155 <https://developers.google.com/native-client/dev/devguide/devcycle/vs-addin>`_ | 170 <devguide/devcycle/vs-addin>` on Windows, or Xcode on Mac OSX. |
156 on Windows, or Xcode on Mac OSX. | |
157 | |
158 .. TODO: update link to Visual Studio when ReST-ified. | |
159 | 171 |
160 I'm not familiar with native development tools, can I still use the Native Clien
t SDK? | 172 I'm not familiar with native development tools, can I still use the Native Clien
t SDK? |
161 --------------------------------------------------------------------------------
------ | 173 --------------------------------------------------------------------------------
------ |
162 | 174 |
163 You may find our :doc:`Tutorial <devguide/tutorial/index>` and :doc:`Building | 175 You may find our :doc:`Tutorial <devguide/tutorial/index>` and :doc:`Building |
164 instructions <devguide/devcycle/building>` useful, and you can look at | 176 instructions <devguide/devcycle/building>` useful, and you can look at |
165 the code and Makefiles for the SDK examples to understand how the | 177 the code and Makefiles for the SDK examples to understand how the |
166 examples are built and run. | 178 examples are built and run. |
167 | 179 |
168 You'll need to learn how to use some tools (like GCC, LLVM, make, | 180 You'll need to learn how to use some tools (like GCC, LLVM, make, |
169 Eclipse, Visual Studio, or Xcode) before you can get very far with the | 181 Eclipse, Visual Studio, or Xcode) before you can get very far with the |
170 SDK. Try seaching for an `introduction to GCC | 182 SDK. Try seaching for an `introduction to GCC |
171 <https://www.google.com/search?q=gcc+introduction>`_. | 183 <https://www.google.com/search?q=gcc+introduction>`_. |
172 | 184 |
173 | 185 |
174 Openness, and Supported Architectures and Languages | 186 Openness, and Supported Architectures and Languages |
175 =================================================== | 187 =================================================== |
176 | 188 |
177 Is Native Client open? Is it a standard? | 189 Is Native Client open? Is it a standard? |
178 ---------------------------------------- | 190 ---------------------------------------- |
179 | 191 |
180 Native Client is completely open: the executable format is open and the | 192 Native Client is completely open: the executable format is open and the |
181 `source code is open <https://code.google.com/p/nativeclient/>`_. Right | 193 `source code is open <https://code.google.com/p/nativeclient/>`_. Right |
182 now the Native Client project is in its early stages, so it's premature | 194 now the Native Client project is in its early stages, so it's premature |
183 to consider Native Client for standardization. | 195 to consider Native Client for standardization. |
184 | 196 |
185 We consistenly try to document our design and implementation and hope to | 197 We consistenly try to document our design and implementation and hope to |
186 standardize Portable Native Client when it gains more traction. A good | 198 standardize Portable Native Client when it gains more traction. A good |
187 example is our `PNaCl bitcode reference manual | 199 example is our :doc:`PNaCl bitcode reference manual |
188 <http://www.chromium.org/nativeclient/pnacl/bitcode-abi>`_. | 200 <reference/pnacl-bitcode-abi>`. |
189 | |
190 .. TODO Update the above bitcode-abi link to a :doc: once 3693 is fixed. | |
191 | 201 |
192 What are the supported instruction set architectures? | 202 What are the supported instruction set architectures? |
193 ----------------------------------------------------- | 203 ----------------------------------------------------- |
194 | 204 |
195 Portable Native Client uses an architecture-independent format (the | 205 Portable Native Client uses an architecture-independent format (the |
196 ``.pexe``) which can currently be translated to execute on processors | 206 ``.pexe``) which can currently be translated to execute on processors |
197 with the x86-32, x86-64, and ARM instruction set architectures, as well | 207 with the x86-32, x86-64, and ARM instruction set architectures, as well |
198 as experimental support for MIPS. As new architectures come along and | 208 as experimental support for MIPS. As new architectures come along and |
199 become popular we expect Portable Native Client to support them without | 209 become popular we expect Portable Native Client to support them without |
200 developers having to recompile their code. | 210 developers having to recompile their code. |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 Portable Native Client should support SIMD vectors in the near future. | 277 Portable Native Client should support SIMD vectors in the near future. |
268 | 278 |
269 Can I use Native Client for 3D graphics? | 279 Can I use Native Client for 3D graphics? |
270 ---------------------------------------- | 280 ---------------------------------------- |
271 | 281 |
272 Yes. Native Client supports `OpenGL ES 2.0 | 282 Yes. Native Client supports `OpenGL ES 2.0 |
273 <https://www.khronos.org/opengles/>`_. | 283 <https://www.khronos.org/opengles/>`_. |
274 | 284 |
275 | 285 |
276 To alert the user regarding their hardware platform's 3D feature set | 286 To alert the user regarding their hardware platform's 3D feature set |
277 before loading a large NaCl application, see `Vetting the driver in | 287 before loading a large NaCl application, see :doc:`Vetting the driver in |
278 Javascript | 288 Javascript <devguide/coding/3D-graphics>`. |
279 <https://developers.google.com/native-client/devguide/coding/3D-graphics>`_. | |
280 | |
281 .. TODO Update link to point to the right place in the document once | |
282 .. it's ReST-ified. | |
283 | 289 |
284 Some GL extensions are exposed to Native Client applications, see the | 290 Some GL extensions are exposed to Native Client applications, see the |
285 `GL ES 2 file | 291 `GL ES 2 file |
286 <https://src.chromium.org/viewvc/chrome/trunk/src/ppapi/lib/gl/gles2/gles2.c>`_. | 292 <https://src.chromium.org/viewvc/chrome/trunk/src/ppapi/lib/gl/gles2/gles2.c>`_. |
287 This file is part of the GL wrapper supplied by the library | 293 This file is part of the GL wrapper supplied by the library |
288 ``ppapi_gles2`` which you'll want to include in your project. In most | 294 ``ppapi_gles2`` which you'll want to include in your project. In most |
289 cases extensions map to extensions available on other platforms, or | 295 cases extensions map to extensions available on other platforms, or |
290 differ very slightly (if they differ, the extension is usually CHROMIUM | 296 differ very slightly (if they differ, the extension is usually CHROMIUM |
291 or ANGLE instead of EXT). | 297 or ANGLE instead of EXT). |
292 | 298 |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 * The ``.nexe`` files must have been compiled using SDK version 0.5 or | 567 * The ``.nexe`` files must have been compiled using SDK version 0.5 or |
562 greater. | 568 greater. |
563 * You must load the correct ``.nexe`` file for your machine's specific | 569 * You must load the correct ``.nexe`` file for your machine's specific |
564 instruction set architecture (x86-32, x86-64 or ARM). You can ensure | 570 instruction set architecture (x86-32, x86-64 or ARM). You can ensure |
565 you're loading the correct ``.nexe`` file by building a separate | 571 you're loading the correct ``.nexe`` file by building a separate |
566 ``.nexe`` for each architecture, and using a ``.nmf`` manifest file to | 572 ``.nexe`` for each architecture, and using a ``.nmf`` manifest file to |
567 let the browser select the correct ``.nexe`` file. Note: the need to | 573 let the browser select the correct ``.nexe`` file. Note: the need to |
568 select a processor-specific ``.nexe`` goes away with Portable Native | 574 select a processor-specific ``.nexe`` goes away with Portable Native |
569 Client. | 575 Client. |
570 * If things still aren't working, :doc:`ask for help <help>`! | 576 * If things still aren't working, :doc:`ask for help <help>`! |
OLD | NEW |