Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

改善 Android Studio 的构建速度 #5978

Merged
merged 4 commits into from
Jun 22, 2019
Merged

Conversation

qiuyuezhong
Copy link
Contributor

译文翻译完成,resolve #5916

@csming1995
Copy link

校对认领

@fanyijihua
Copy link
Collaborator

@csming1995 好的呢 🍺

@leviding
Copy link
Member

@csming1995 记得校对哈

Copy link

@csming1995 csming1995 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@csming1995 记得校对哈

收到,正在校对中~


In this article, we’ll share some of the new analytics* we’ve put in place to better pinpoint what is really affecting build speed and share more about what we’re doing about it, as well as what you can do today to help prevent your build from slowing down.
在这篇文章中,我们将分享一些新的分析方法,以便更好的指出是什么真正影响了构建速度,并分享一些我们正在为此所作的工作,以及你今天能做些什么来防止构建速度变慢。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

『以及你今天能做些什么来防止构建速度变慢。』->『以及你能做些什么来防止构建速度变慢。』
今天去掉,感觉会更符合语境一些。


* **This is possible thanks to many developers opting-in to sharing their usage statistics with us in “preference > data sharing”**
* **感谢很多开发者选择在“首选项 > 数据共享”中与我们共享他们的使用统计信息,使得这件事情变得可能。**
Copy link

@csming1995 csming1995 Jun 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感谢很多开发者在“首选项 > 数据共享”中选择与我们共享他们的使用统计信息,使得这件事情变得可能。』->『感谢很多开发者选择在“preference > data sharing”中与我们共享他们的使用统计信息,使得这件事情变得可能。
引号中的英文,应该是特殊名词用法,需要保留。


![](https://cdn-images-1.medium.com/max/2404/0*HgKjMF_Usu73_ihR)

We also looked at “real-world” data, focusing on build speed of a couple of debug build right before and right after an upgrade of the Android Gradle plugin. We used this as a proxy of the actual improvement of a new release.
我们还研究了真实的数据,主要关注 Android Gradle 插件升级前后构建调试版本的速度。我们用它来表示新版本上构建速度实际提升。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

『我们用它来表示新版本上构建速度实际提升。』->『我们用它来体现在新版本上构建速度的实际提升。』


This showed really good improvement with new releases,** helping reduce build time by almost 50% since 2.3.**
这显示出在新版本上,构建速度确实改善了很多,自 2.3 版本以来,构建时间提升了将近 50%

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

『这显示出在新版本上』->『这表明了在新版本上』


![](https://cdn-images-1.medium.com/max/2992/0*l55G21vNHzBc-D7D)

Last, we looked at the evolution of build time over time, regardless of versions. We used this as a proxy of what your actual builds speed is over time. This shows, sadly, that build speed are slowing over time.
最后,我们在不论版本如何的情况下,研究了构建时间随着时间的演变。我们用它来表示实际构建速度随时间的变化。遗憾的是,这表明构建速度随着时间的推移而减慢。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

『我们在不论版本如何的情况下』->『我们在无视版本变化的情况下』

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

『遗憾的是,这表明构建速度随着时间的推移而减慢。』->『遗憾的是,结果表明了构建速度是随着时间的推移而减慢的。』


We dug a little deeper and realized that things happening in our ecosystem are causing build to slow down faster than we can improve.
我们研究得更深入之后,意识到在我们的生态系统中发生的事情正在导致构建速度减慢,这比我们能够提升的要快。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

『我们研究得更深入之后,意识到在我们的生态系统中发生的事情正在导致构建速度减慢,这比我们能够提升的要快。』->『我们在更深入的研究之后,意识到在我们的生态系统中发生的事情导致构建速度减慢的速度比我们提升的速度更快。』


While we knew that project growth — with more code, more resource usage, more language features — was making build slower over time, we also discovered that there are many additional factors beyond our immediate control:
虽然我们知道随着时间的推移,代码的增加、资源的使用、语言特性的增加,使项目的构建速度越来越慢,但我们还发现,还有许多其他因素超出了我们的直接控制范围:
Copy link

@csming1995 csming1995 Jun 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

『虽然我们知道随着时间的推移』->『虽然我们知道随着项目的迭代』


We also included R light class generation, lazy task and worker API in recent releases and are continuing to collaborate with Gradle inc. and JetBrains to continue improving build performance overall.
在最近的版本中,我们还加入了 R light class generationlazy task worker API,并继续与 Gradle Inc. 和 JetBrains 合作,以继续改善总体构建性能。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

『以继续改善总体构建性能』->『以持续改善总体构建性能』


While configuration time can vary based on the number of variants, modules and other things, we wanted to share, as reference point, the configuration time associated with the **Android Gradle Plugin** from “real-world” data
虽然配置时间可能因变量、模块和其他因素的数量而有所不同,但我们希望将与 **Android Gradle 插件**相关联的配置时间作为参考点,并和现实数据共享。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

『并和现实数据共享』->『并和实际场景共享数据』

* Only use configuration to set up tasks (with lazy API), avoid doing any I/O or any other work. (Configuration is not the right place to query git, read files, search for connected device(s), do computation etc)
* Set up all the tasks in configuration. Configuration is not aware of what actually gets built.
* 仅使用配置来创建任务(使用 lazy API),避免在其中执行任何 I/O 或任何其他工作。(配置不适合查询 git、读取文件、搜索连接的设备、进行计算等)。
* 在配置中创建所有的任务,配置不会知道实际生成了什么内容。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

『在配置中创建所有的任务,配置不会知道实际生成了什么内容。』->『在配置中创建所有的任务。配置不会知道实际生成了什么内容。』

* 将复杂的步骤拆分为多个任务,以帮助实现增量化和可缓存性。
(有些任务可以是最新的,而另一些任务可以执行或并行执行)。
* 确保任务不会写入或删除其他任务的输出。
* Java/Kotlin 中用插件或 buildSrc 编写任务,而不是在 Groovy 中直接构建。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

『在 Java/Kotlin 中用插件或 buildSrc 编写任务,而不是在 Groovy 中直接构建。』->『在插件或 buildSrc 中用 Java/Kotlin 编写任务,而不是在 build.gradle 中用 Groovy 直接编写。』


We care about your productivity as a developer. As we continue to work on making builds faster, hopefully the tips and guidelines here will help you keep your build times down so you can focus more on developing amazing apps.
作为开发者,我们关心你的生产力。随着我们持续努力加快构建速度,希望这里的提示和指导方针能够帮助你缩短构建时间,以便让你能够更加专注于开发精彩的应用程序。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

『随着我们持续努力加快构建速度』->『随着我们为加快构建速度而持续努力』

@csming1995
Copy link

@qiuyuezhong @leviding 校对完毕~

@leviding leviding added the enhancement 等待译者修改 label Jun 19, 2019
@qiuyuezhong
Copy link
Contributor Author

@qiuyuezhong @leviding 校对完毕~

@csming1995 根据您的建议,修改完成 @leviding 修改完成

@leviding leviding added Tag 一次校对修改完成 and removed enhancement 等待译者修改 labels Jun 20, 2019
@csming1995
Copy link

@qiuyuezhong @leviding 校对完毕~

@csming1995 根据您的建议,修改完成 @leviding 修改完成

🤝🤝🤝

Copy link
Member

@leviding leviding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@leviding leviding merged commit e9a26f6 into xitu:master Jun 22, 2019
@leviding
Copy link
Member

@qiuyuezhong 已经 merge 啦~ 快快麻溜发布到掘金然后给我发下链接,方便及时添加积分哟。

掘金翻译计划有自己的知乎专栏,你也可以投稿哈,推荐使用一个好用的插件
专栏地址:https://zhuanlan.zhihu.com/juejinfanyi

@leviding leviding added 翻译完成 and removed Tag 一次校对修改完成 校对认领 正在校对 labels Jun 22, 2019
@qiuyuezhong
Copy link
Contributor Author

@qiuyuezhong 已经 merge 啦~ 快快麻溜发布到掘金然后给我发下链接,方便及时添加积分哟。

掘金翻译计划有自己的知乎专栏,你也可以投稿哈,推荐使用一个好用的插件
专栏地址:https://zhuanlan.zhihu.com/juejinfanyi

不好意思,发布晚了 https://juejin.im/post/5d1388b1f265da1b6d403560

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

改善 Android Studio 的构建速度
4 participants