编译纯armv7架构有什么好处/后果?

发布于 2024-09-03 16:46:03 字数 90 浏览 5 评论 0原文

在编译 iPhone 应用程序时,有一个“优化”架构(仅限armv7)与标准armv6/armv7架构的设置。

编译纯armv7架构有什么好处/后果?

In compiling iPhone apps, there is a setting for "Optimized" architecture (armv7 only) vs a standard armv6/armv7 architecture.

What are the benefits/consequences of compiling an armv7 only architecture?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

人生百味 2024-09-10 16:46:03

除非您的程序需要 OpenGLES 2.0(仅在支持 armv7 的设备上受支持),否则您应该编译标准 fat (armv6/armv7) 二进制文件。胖二进制文件基本上是两个(或更多)Mach-O 二进制文件粘合在一起,开头有一个标题页。性能成本可以忽略不计:动态加载器必须对标头页进行额外的页面错误以确定要加载的体系结构。

仅针对armv7进行构建基本上会将可执行文件的大小减半,尽管您的可执行文件一开始不太可能那么大。您可以在主机上使用“size”和“otool”命令来获取有关应用程序二进制文件中各个部分的更多信息,例如“size -arch armv6 build/Release/MyApp.app/MyApp”将获取各个部分的大小在armv6版本的二进制文件中,“size -arch armv7 build/Release/MyApp.app/MyApp”将获取armv7版本的二进制文件中各个部分的大小,显然“ls -l build/Release/MyApp” .app/MyApp”将获取二进制文件的实际文件大小。

Unless your program requires OpenGLES 2.0 (which is only supported on armv7-supporting devices), you should compile the standard fat (armv6/armv7) binary. A fat binary is basically two (or more) Mach-O binaries glued together, with a single header page at the beginning. The performance cost is negligible: the dynamic loader must take an extra page fault for the header page to determine which architecture to load.

Building for armv7 only will essentially halve the size of your executable, although it's unlikely that your executable is all that large to begin with. You can use the "size" and "otool" commands on the host to get more information about the various sections in your app's binary, e.g. "size -arch armv6 build/Release/MyApp.app/MyApp" will get the size of various sections in the armv6 version of a binary, "size -arch armv7 build/Release/MyApp.app/MyApp" will get the size of various sections in the armv7 version of a binary, and obviously "ls -l build/Release/MyApp.app/MyApp" will get the actual file size of the binary.

浅唱々樱花落 2024-09-10 16:46:03

较小的可执行文件从应用程序商店下载速度更快。但是,您确实会删除非armv7设备

A smaller executable is a faster download from the app store. However, you do cut out non-armv7 devices.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文