简体   繁体   English

Android Studio 性能是否随 CPU 内核数量而扩展?

[英]Does Android Studio Performance Scale Well With Number Of CPU Cores

for example AMD Ryzen 5 1600 has 6 (2 logical cores per physical) cores with Clockspeed: 3.2 GHz Turbo Speed: 3.6 GHz .例如AMD Ryzen 5 1600有 6 个(每个物理 2 个逻辑核心)核心,时钟速度:3.2 GHz 涡轮速度:3.6 GHz。

In contrast, Intel Core i5-7600 has 4 cores with Clockspeed: 3.5 GHz Turbo Speed: 4.1 GHz.相比之下,英特尔酷睿 i5-7600有 4 个核心,时钟速度:3.5 GHz 涡轮速度:4.1 GHz。

My exprience, Ryzen 1600 perform litle bit better than i5 7600 I have seen many games benchmarks where both processor are neck to neck and performace of Ryzen only imperasive in case of video rendring, encoding, file Zipping etc otherwise no where I found major difference.Even majorly I found i5 7600 performing better.我的经验,Ryzen 1600 的性能比 i5 7600 好一点我见过许多游戏基准测试,其中两个处理器并驾齐驱,而 Ryzen 的性能仅在视频渲染、编码、文件压缩等情况下才具有强制性,否则我没有发现主要区别。甚至主要我发现 i5 7600 表现更好。

All in all,Here are my questions....总而言之,这是我的问题....

  • Does the number of cores really matter for Android studio?内核数量对 Android Studio 真的很重要吗?
  • Does higher clock speed matter for Android studio?更高的时钟速度对 Android Studio 是否重要?

I have had this question for a long time, and have just taken the jump from Intel i5-3570K @ 3.4 GHz (4-core) to AMD Ryzen 7 2700 @ 3.2 GHz(8-core).我有这个问题很久了,刚刚从 Intel i5-3570K @ 3.4 GHz(4 核)跳到 AMD Ryzen 7 2700 @ 3.2 GHz(8 核)。 Let me share my test results.分享一下我的测试结果。

+--------------------------------+--------------------------+---------------------------+
|                                | Intel i5-3570K @ 3.4GHz  | AMD Ryzen 7 2700 @ 3.2GHz |
|                                | (4-core) 32GB DDR3 RAM   | (8-core) 32GB DDR4 RAM    |
+--------------------------------+--------------------------+---------------------------+
| Rebuild the debug version of   | 2m 15s                   | 1m 3s                     |
| an app after cleaning it.      |                          |                           |
+--------------------------------+--------------------------+---------------------------+
| Build, copy and FTP a release  | 5m 5s                    | 4m 5s                     |
| package after the above task   |                          |                           |
+--------------------------------+--------------------------+---------------------------+

The second test is largely consumed by Proguard's minifying and obfuscation.第二个测试主要被 Proguard 的缩小和混淆所消耗。 I did all the tests within 24 hours immediately before and after upgrading the PC with new motherboard, CPU and RAM.我在用新主板、CPU 和 RAM 升级 PC 前后的 24 小时内完成了所有测试。 The two drives (an SSD and an HD) stayed.两个驱动器(一个 SSD 和一个 HD)保持不变。

Thanks to Microsoft , Android emulators can run on AMD CPU-based PCs now. 感谢微软,Android 模拟器现在可以在基于 AMD CPU 的 PC 上运行。 The emulators on this Ryzen 7 machine are unbelievably fast.这台 Ryzen 7 机器上的模拟器速度快得令人难以置信。 It takes only 14 seconds to cold-boot a Marshmallow 6.0 - API 23 emulator.冷启动 Marshmallow 6.0 - API 23 模拟器仅需 14 秒。 Starting any app is instant.立即启动任何应用程序。 I seriously doubt any physical Android devices can outperform the emulators.我严重怀疑任何物理 Android 设备都可以胜过模拟器。

I have been hoping to see a benchmark test designed for software development.我一直希望看到为软件开发设计的基准测试。 Almost all benchmark tests seem to target gaming.几乎所有的基准测试似乎都针对游戏。

The two configurations:两种配置: 在此处输入图像描述 在此处输入图像描述

I believe that it depends on the structure of your project, especially when it comes to compiling.我相信这取决于您项目的结构,尤其是在编译方面。 Gradle's option to enable parallel builds only effects the compile time of multi-module projects. Gradle 启用并行构建的选项只会影响多模块项目的编译时间。 If you only have a monolithic module for your entire app, gradle will only make limited use of multiple cores, if at all.如果您的整个应用程序只有一个单体模块,那么 gradle 只会有限地使用多个内核(如果有的话)。

See https://docs.gradle.org/current/userguide/multi_project_builds.html for more information on multi-project builds.有关多项目构建的更多信息,请参阅https://docs.gradle.org/current/userguide/multi_project_builds.html

Another thing to consider when building or buying a machine for Android development: Intel chips allow you to virtualize an Intel-based image in the emulator.在构建或购买用于 Android 开发的机器时要考虑的另一件事:英特尔芯片允许您在模拟器中虚拟化基于英特尔的映像。 This produces a significant increase in speed while testing your app compared to emulating an ARM-based image or running the emulator on an AMD chip.与模拟基于 ARM 的映像或在 AMD 芯片上运行模拟器相比,这会显着提高测试应用程序的速度。

In my opinion as someone who recently built a development PC and works quite frequently and heavily on Android Studio and Intellij (which is basically Android Studio) your CPU is rarely your choke point.在我看来,作为最近构建开发 PC 并且在 Android Studio 和 Intellij(基本上是 Android Studio)上频繁大量工作的人,你的 CPU 很少是你的瓶颈。 Rather I would say it is your amount of memory and the read/write time of your drive.相反,我会说这是您的内存量和驱动器的读/写时间。 Open up task manager or some other hardware monitoring gadget and run a build, you will often see CPU at 40-60%, drive read/write maxed out at 100% and that Android Studio, the emulator (if you use it) and all the Java runtime stuff eating away at your memory.打开任务管理器或其他一些硬件监控小工具并运行构建,你会经常看到 CPU 为 40-60%,驱动器读/写达到 100%,以及 Android Studio、模拟器(如果你使用它)和所有Java 运行时的东西会吞噬你的记忆。

So I would say it is down to personal preference.所以我会说这取决于个人喜好。 I am confident either one will work well.我相信任何一个都能很好地工作。

Does the number of cores really matter for Android studio? 核心数量对Android工作室来说真的很重要吗?

Processing power of computer does matter while using Android studio, in this case as you mentioned both the processors are neck to neck when it comes to processing power, so you won't notice that big of a difference while using Android studio. 在使用Android工作室时,计算机的处理能力确实很重要,在这种情况下,正如您所提到的那样,处理器处理能力都是处理器,因此在使用Android工作室时您不会注意到这一点。 In my opinion i5 should perform better. 在我看来,i5应该表现得更好。

Does higher clock speed matter for Android studio? 更高的时钟速度是否对Android工作室很重要?

Higher clock speed does not ensure high performance, amount of work done in one clock cycle matters. 更高的时钟速度并不能确保高性能,在一个时钟周期内完成的工作量很重要。

if both matters then why Ryzen performing not so well in gaming as compare to i5 who have only 4 cores. 如果两者都很重要,那么为什么Ryzen在游戏中表现不如与只有4个核心的i5相比。

Intel i5 processor does not support hyperthreading but has 4 solid cores and AMD Ryzen 5 1600(3+3 style core design) has been built with an energy efficiency as priority. 英特尔i5处理器不支持超线程,但拥有4个实心内核,AMD Ryzen 5 1600(3 + 3风格核心设计)已经建成,并以能效为优先考虑。

在此处输入图像描述

Well, that was my CPU usage after I started building the project.好吧,那是我开始构建项目后的 CPU 使用率。 So I would say it does use all cores - just not all the time.所以我会说它确实使用了所有内核 - 只是不是一直。

But I also feel like this is my Android Studio being weird.但我也觉得这是我的 Android Studio 很奇怪。 Not really sure.不太确定。

Maybe a little old thread, but here is my experience with I7 4710HQ (4 cores/8 threads) and Ryzen 1600 AF @3.9 GHz: With I7 CPU load while compiling a project is at 100% most of the time and is slower than Ryzen, which loads also at 100% during compilation.也许有点旧线程,但这是我对 I7 4710HQ(4 核/8 线程)和 Ryzen 1600 AF @3.9 GHz 的经验:在编译项目时 I7 CPU 负载大部分时间为 100%,并且比 Ryzen 慢,在编译期间也以 100% 加载。 So android studio and mostly gradle compiler do use all available CPU cores and threads during compilation.因此,android studio 和大多数 gradle 编译器在编译期间确实使用了所有可用的 CPU 内核和线程。

Maybe a little old thread, but if you are using Kotlin and working on a single module project, compilation is heavily single threaded due to limitations with current Gradle.可能是一个有点旧的线程,但如果您使用 Kotlin 并处理单个模块项目,由于当前 Gradle 的限制,编译是高度单线程的。 I know of a lot of devs complaining about the compilation speed being slower than java.我知道很多开发人员抱怨编译速度比 java 慢。 For a big project, going multi modules can speed up quite significantly since it reduces chances to rebuild the entire modules unless modifications are made to those.对于一个大型项目,使用多个模块可以显着加快速度,因为它减少了重建整个模块的机会,除非对这些模块进行修改。 Also different modules can be compiled in parrelel if Gradle parrelel option is enabled hence can fully utilize your fancy hardware spec.如果启用了 Gradle parrelel 选项,也可以在 parrelel 中编译不同的模块,因此可以充分利用您喜欢的硬件规格。

Xeon (logic 48 cores)至强(逻辑 48 核)

Android Studio isn't use all power of my computer while building. Android Studio 在构建时并未使用我计算机的所有功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM