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

remove InetAddress.getLocalHost().hostName call [MERGE_WHEN_READY] #88

Merged
merged 1 commit into from
Jan 23, 2020

Conversation

dsvoronin
Copy link
Contributor

@dsvoronin dsvoronin commented Jan 23, 2020

could take 5+ seconds, and affects every configuration;

probably only on mac: https://thoeni.io/post/macos-sierra-java/

my machine: impact plugin apply 5000ms+ -> 70ms

…e seconds, and affected every configuration;

probably only on mac: https://thoeni.io/post/macos-sierra-java/

my machine: impact plugin apply 5000ms+ -> 70ms
@dsvoronin dsvoronin changed the title remove InetAddress.getLocalHost().hostName call, could took 5 and mor… remove InetAddress.getLocalHost().hostName call [MERGE_WHEN_READY] Jan 23, 2020

return hostName.startsWith("android-builder")
private fun isRunViaMirakle(project: Project): Boolean {
return project.hasProperty("mirakle.build.on.remote")
Copy link
Contributor

Choose a reason for hiding this comment

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

где проставляем это свойство?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

проверил в интеграции руками, свойство видно изнутри билда

@@ -54,10 +54,8 @@ fun isRunFromGradleTestKit(project: Project): Boolean {
fun isRunInGradleTestKit(): Boolean =
System.getProperty("isTest", "false") == "true"

private fun isRunInMainframer(): Boolean {
val hostName = InetAddress.getLocalHost().hostName
Copy link
Contributor

Choose a reason for hiding this comment

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

дорогой вызов?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

да, эта

Copy link
Contributor

Choose a reason for hiding this comment

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

Как ты наткнулся на это?

Copy link
Contributor

Choose a reason for hiding this comment

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

это выглядит как подвисающая кофигурация, когда внутри пытаемся резолвить localhost

@eugene-krivobokov
Copy link
Contributor

мда...
предлагаю вернуть кастомной детектор этой проблемы
удалил после того как в gradle сделали workaround

@eugene-krivobokov eugene-krivobokov merged commit 3591935 into develop Jan 23, 2020
@eugene-krivobokov eugene-krivobokov deleted the performanceproblems branch January 23, 2020 18:08
@dsvoronin
Copy link
Contributor Author

мда...
предлагаю вернуть кастомной детектор этой проблемы
удалил после того как в gradle сделали workaround

ну в целом оно и не нужно, это единственный вызов в узком месте у нас

@eugene-krivobokov
Copy link
Contributor

Описал причины, почему нужно самим отлавливать и не ходить по минному полю.
Одного этого бага уже достаточно для подтверждения гипотезы.

* IDEA добавляет специальный init script, по нему понимаем что запустили в IDE
* используется в :test-project
*/
systemProperty("isInvokedFromIde",
Copy link
Contributor

Choose a reason for hiding this comment

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

Как ты узнал про это?
А где почитать про концепцию инитскриптов?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

узнал просто залогировав параметры на старте, из консоли и из IDE различаются немного, это позволило сделать такую проверку
она не супер грамотная, т.к. только JB IDE детектит, но у меня не было цели все закрыть

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

Successfully merging this pull request may close these issues.

None yet

3 participants