Как уменьшить времена MSBuild

Я не уверен, что это лучший способ, но он должен работать. Поместите это в функцию фокусировки:

var fv = $('#myform').validate();

// setTimeout is needed to let validation to complete
var currentElement = this;
setTimeout(function() {
    let error = fv.errorList.filter(function (e) { return e.element == currentElement; })[0];
    console.log(error.message);
});
18
задан Peter Mortensen 18 June 2017 в 10:05
поделиться

2 ответа

We also have huge solutions. Build and compilation is all about I/O.

Solid-state drives are very promising. A co-worker put a solid-state drive in his laptop, and found that it is now much faster than his humongous main development box. Don't have the details, but he claims many times faster.

We've been fiddling with solution folders to group parts of the project: This makes it easier for devs to unload projects they aren't working on.

/m rarely helps with .NET debug builds. I ran a series of tests on this a few weeks ago and found minor differences. Findings:

  • Because my build is I/O constrained, using /m:2-4 makes debug builds slower for me.
  • Release builds usually much faster.
  • Code analysis adds a lot of time.

Big picture: In reality, compilation is a pretty minor cost for me, compared to getting source and running unit tests. On our build server, the integration tests and packaging are almost all the time. For my development box, I schedule a batch file that gets source, builds, runs unit tests before I come to work and while I'm at lunch. Good enough.

On the build server, it's more complicated. We're thinking of setting up chained parallel CruiseControl.NET builds on various machines. We are using VSTS build, but it is too expensive (and time consuming) to scale horizontally like this.

My numbers for detail-oriented folks. Configurations from slowest to fastest, running msbuild "bigsolution.sln" /target:clean - between each.

  1. /m: 4, Debug with code analysis 1:38
  2. /m: 1, Debug with code analysis 1:30
  3. /m: 4, Debug with no code analysis 1:30
  4. /m: 1, Debug with no code analysis 1:30
  5. /m: 1, Release with code analysis: 1:30
  6. /m: 4, Release with code analysis: 1:05
  7. /m: 4, Release with no code analysis: 0:53

Build time without rebuild or clean: ~ 4-10 seconds

3
ответ дан 30 November 2019 в 08:04
поделиться

Время сборки MSBuild - многомерная проблема. Хорошая новость в том, что это легко решить:

В отличие от большинства процессов, запущенных на машине сборки, процессы сборки печально известны тем, что потребляют ресурсы ЦП, ОЗУ и ввода-вывода. Общий рецепт для ускорения сборки MSBuild - «получить лучшую машину, которую можно купить за деньги», в частности:

  1. ЦП - не менее двух Intel 3.0 ГГц Core 2 Duo.

  2. ОЗУ - не менее 4 ГБ DDR3. Если это машина для разработчиков и , то лучшим вариантом будет 64-разрядная ОС и 8 ГБ ОЗУ.

  3. Жесткий диск. Самым быстрым вариантом является высокопроизводительный 3ware RAID-1 с включенным аккумулятор платы и включенный кэш записи. Другой вариант, который стоит рассмотреть, - быстрый SSD.

  4. Сеть - карта минимум 1 Гбит / с.

Эта простая аппаратная оптимизация может ускорить ваши сборки MSBuild в 2-3 раза.

1
ответ дан 30 November 2019 в 08:04
поделиться
Другие вопросы по тегам:

Похожие вопросы: