[00:00:01] [music] [00:00:06] >> Thanks, Maddie. [00:00:07] Uh yeah, we're going to talk about MS [00:00:08] Build some more. You just got a good [00:00:10] chunk of MS Build and MS Build adjacent [00:00:12] stuff. Um we're going to pull it back a [00:00:14] little bit, be a little bit more [00:00:15] conservative here, [laughter] [00:00:17] uh but all aligned towards the same goal [00:00:19] of making the builds that are happening [00:00:21] on your machine, your CI machine, your [00:00:23] agent's context faster while not [00:00:26] sacrificing correctness or the [00:00:28] extensibility and functionality that you [00:00:30] need today. [00:00:31] Um so the the headline of this is [00:00:34] performance, right? So I want to get [00:00:37] right to the numbers and then we'll talk [00:00:38] about like how this new multi-threaded [00:00:41] mode works, the things that we had to [00:00:42] change, and show you like with some [00:00:44] hands-on uh code [00:00:47] the kinds of changes that we need, [00:00:49] external and internal task authors to [00:00:51] make in order to get the maximum benefit [00:00:53] out of this, right? [00:00:54] Uh so yeah, let's let's show the good [00:00:57] stuff. [00:00:58] Here is Orchard Core. We love using [00:01:00] Orchard Core. Um we have a Perf Lab [00:01:03] setup that we've been working on for uh [00:01:05] a while now, tracking builds of Orchard [00:01:08] Core, Aspire, uh the Azure SDK for .NET, [00:01:12] a whole bunch of key scenarios. Um but [00:01:14] Orchard Core is the one we like to focus [00:01:16] on because it has about 100 projects in [00:01:18] it across each one of those has at least [00:01:21] two target frameworks. So it's a it's a [00:01:22] fairly heavy build. [00:01:24] With no other changes in .NET 11 aside [00:01:27] from adding the dash MT flag to the [00:01:30] build, [00:01:31] cold builds are reduced by about a [00:01:33] quarter on Windows and a little more [00:01:35] than 10% on Linux. [00:01:37] This is great um in my opinion because [00:01:40] this is keeping the same compatibility [00:01:42] and correctness guarantees that we've [00:01:44] had the entire time and evolving the way [00:01:46] the engine works to get some of this [00:01:48] perf. [00:01:49] Um but for me, the true awesome story of [00:01:52] multi-threaded MS Build is actually the [00:01:54] incremental builds, the inner loops [00:01:56] where you've changed just a single file [00:01:59] in a single project or a of in a project [00:02:01] and that needs to flow out to your other [00:02:04] uh repositories. Here are the same build [00:02:06] of Orchard Core but with no changes and [00:02:09] you can see especially on Windows the [00:02:10] impact is huge. Um this warm incremental [00:02:14] build is what we think of as the truest [00:02:16] representation of the um overhead we [00:02:20] like to call it of the MS Build engine [00:02:21] in a given project. So given a workspace [00:02:24] topology and arrangement of projects and [00:02:27] the relationships between them [00:02:29] with a purely incremental warm build, [00:02:31] how fast can we burn through that? [00:02:34] So uh unlike the demos you just saw, [00:02:37] we're not skipping any work here. We [00:02:39] could possibly be skipping more and [00:02:41] we'll talk about like improvements to [00:02:43] the logic of the build perhaps a bit [00:02:45] later on, but this is just can we do [00:02:47] what we're doing today so we maintain [00:02:49] compat even faster? And the answer is [00:02:51] yes. [00:02:52] Uh so these numbers are numbers that we [00:02:55] want you to try and achieve as well. [00:02:57] When you download .NET 11 [00:02:59] and add the MT flag, we want to see how [00:03:02] that behaves for you. Uh at this point [00:03:04] we've done the work so that builds of [00:03:07] console and library application should [00:03:09] be almost entirely enlightened. It's [00:03:11] what we call it when things are made [00:03:13] compatible with multi-threading uh and [00:03:15] our next big steps are packing, [00:03:17] publishing web applications and this [00:03:19] kind of thing. But try it out, let us [00:03:21] know how it works for you. We think you [00:03:23] will have generally the same bands here. [00:03:26] We are targeting making this behavior [00:03:29] the default in 110200 so this winter's [00:03:32] build of .NET 11. So [00:03:35] we want you to get hands on and we think [00:03:37] you'll want to too with these kind of [00:03:39] performance numbers. [00:03:41] So [00:03:42] where is this coming from? [00:03:44] Uh we're going to talk a little bit [00:03:46] about how MS Build works today so that [00:03:48] you can see what we've done to get these [00:03:51] kind of numbers and you can kind of see [00:03:52] where we want to go to improve on this. [00:03:55] But in general this number is coming [00:03:57] from uh less duplicated work in the [00:04:00] engine between the different worker [00:04:02] nodes which we'll talk about in a bit, [00:04:04] uh fewer task context switches and uh [00:04:07] reusing more server state because this [00:04:10] multi-threaded MSBuild mode is built on [00:04:13] a new long-lived MSBuild server daemon [00:04:16] that we hope to reuse for future caching [00:04:19] and performance work in well, the [00:04:21] future. [00:04:23] So to get these numbers, what did we [00:04:24] have to change? Let's start with how [00:04:26] things work today. [00:04:28] Today, when you run a build, this is [00:04:30] .NET build, this is .NET pack of a [00:04:32] solution, of a project, what have you. [00:04:35] What happens is that build goes to what [00:04:37] we call a central scheduling node, and [00:04:39] this node is kind of like the primary [00:04:41] coordinator. It is responsible for [00:04:44] evaluating all the projects in the build [00:04:46] and determining their characteristics [00:04:48] and then scheduling the work, the [00:04:51] individual builds that need to happen. [00:04:53] Uh all of the actual building happens on [00:04:56] what we call worker nodes. So in the [00:04:59] previous uh chart that you saw uh the [00:05:01] DevKit team showing with those stale [00:05:03] worker nodes, those were workers that [00:05:05] were waiting to be given work and just [00:05:08] idle until they got new work. So the [00:05:10] goal of MSBuild is to efficiently spread [00:05:13] the available work to those nodes. [00:05:16] Each worker node processes different [00:05:19] configurations of the project, right? So [00:05:21] if you have a multi-targeted project for [00:05:24] .NET 11 and .NET Framework 481, for [00:05:27] example, or 482, that is two different [00:05:30] configurations from the point of view of [00:05:33] MSBuild. So those different project [00:05:35] builds could technically happen on [00:05:36] different worker nodes. [00:05:38] Today, in standard MSBuild, those worker [00:05:41] nodes are dedicated processes. And so [00:05:44] each process has to stand up, it has to [00:05:46] load binaries, it has to load your [00:05:48] custom tasks, and it has to process the [00:05:51] state of each configuration that it has [00:05:53] and serve results to the other worker [00:05:56] nodes if there are project-to-project [00:05:58] relationships. [00:06:00] Like I mentioned, a configuration is [00:06:02] more than just a single project file. [00:06:04] When we say that Orchard Core has 100 [00:06:06] projects, if each of those projects has [00:06:09] two target frameworks, that is actually [00:06:11] more like 300 configurations [00:06:14] because each of those projects has one [00:06:18] top-level project and one project, [00:06:22] logical project for each target [00:06:24] framework, right? So here are a couple [00:06:26] examples of two different configurations [00:06:28] of the same project. [00:06:30] Why this is important to know is because [00:06:32] each different configuration is its own [00:06:35] sort of bubble of state and can be given [00:06:38] to a different worker. [00:06:39] And when state needs to be given [00:06:42] to a different worker for a project [00:06:44] reference or what not, that triggers [00:06:47] communication between the worker nodes, [00:06:49] right? [00:06:50] So what will happen is on a particular [00:06:53] worker node, that configuration, all of [00:06:55] its known properties and items as well [00:06:58] as all of the target results for that [00:07:00] configuration will be on one node. And [00:07:03] then if another node needs to call and [00:07:05] retrieve results, there will be [00:07:07] node-to-node communication at multiple [00:07:09] points during that build, right? [00:07:12] So we reuse [00:07:14] the results of each uh [00:07:16] target for each configuration, but that [00:07:19] reuse comes at the cost of having to [00:07:21] potentially talk to another node, right? [00:07:24] And this communication happens with [00:07:26] interprocess communication. MSBuild uses [00:07:29] a custom binary protocol uh [00:07:31] that handshakes between the centralized [00:07:33] scheduler and the worker processes and [00:07:36] communicates data back and forth, right? [00:07:38] The worker processes both do the build [00:07:40] and execute tasks uh as long as those [00:07:44] tasks are the same architecture and the [00:07:46] same uh process affinity. There's a [00:07:49] third kind of out-of-process component [00:07:51] that we will uh [00:07:53] need to talk about here as well, which [00:07:54] is a task host for when a task needs to [00:07:57] run in a different architecture, for [00:07:59] example, or or when you need to run a [00:08:02] .NET framework task, or sorry, a .NET [00:08:05] modern task from .NET framework MSBuild, [00:08:09] but in general, most tasks are going to [00:08:11] run directly in the worker process to [00:08:13] minimize that inter-process [00:08:14] communication. [00:08:16] So, [00:08:17] every message, every piece of [00:08:18] communication has to go across this [00:08:20] channel. It's important that this [00:08:22] channel is efficient. It's important [00:08:23] that we do everything right there so [00:08:25] that the IPC isn't a throughput issue. [00:08:30] Well, [00:08:32] any IPC is going to eventually be a [00:08:35] bottleneck when you get into a large [00:08:37] enough multi-node system. And so, a [00:08:39] while back we started thinking about [00:08:41] could we eliminate or minimize the IPC [00:08:43] costs by bringing the nodes together. [00:08:47] And so, we started working on this and [00:08:50] the core model of MSBuild still remains. [00:08:52] You still have that scheduler, that [00:08:56] central delegator, but now each of the [00:08:58] worker nodes is just a thread instead of [00:09:02] an entire process. And this gets us two [00:09:05] major sources of efficiency today. The [00:09:08] first is that it exchanges IPC for like [00:09:12] in-process message passing, which is [00:09:15] much less overhead. And it also reduces [00:09:18] certain fixed costs that each of the [00:09:21] standalone worker node processes had, [00:09:23] right? It's not a ton, but it costs some [00:09:26] time to store or to start up a core CLR [00:09:29] instance. It's not a ton, but it does [00:09:32] take time to load and jit all the [00:09:35] runtime DLLs that are used. It does take [00:09:37] time to load and jit all of the task [00:09:39] assemblies that are used in the build, [00:09:41] right? And so, by bringing these things [00:09:43] into the same process, we can reuse [00:09:46] those loads. We can amortize that fixed [00:09:50] startup and achieve some efficiencies [00:09:52] there as well. [00:09:53] This is especially impactful when a [00:09:56] build doesn't do much work because if [00:09:58] you don't have to execute tasks, then [00:10:01] all of the work of the build is running [00:10:04] through evaluations, skipping targets, [00:10:06] and passing messages between nodes. All [00:10:08] of that is much faster in multi-threaded [00:10:11] MSBuild than multiprocess. [00:10:14] But there are some hurdles [00:10:17] uh that we had to uh [00:10:19] find ways of working against, right? [00:10:22] Tasks today get to pretend like they are [00:10:25] in completely separate processes that [00:10:27] they own because the worker nodes and [00:10:29] the task hosts in those worker nodes [00:10:32] establish boundaries around things like [00:10:34] process state, [00:10:35] right? So [00:10:37] for better or for worse, the BCL expo [00:10:39] sorry, the base class library exposes a [00:10:41] lot of static state that is uh [00:10:44] sort of orchestrated at the process [00:10:46] level. My favorite example is [00:10:48] environment.current directory. [00:10:50] This is something that is readable by [00:10:52] anything in a process and if you change [00:10:54] it once, it changes it for all threads, [00:10:57] all running code in that process. [00:11:00] Tasks today, both our own and those that [00:11:03] come from the community, are free to do [00:11:05] that because nothing is ever told them [00:11:07] no. But mm poking at that process level [00:11:10] state is one of the cardinal sins of any [00:11:13] multi-threaded system in general. So we [00:11:16] needed to try and devise a way where [00:11:18] tasks could have a safe way of [00:11:21] interacting with that data when they [00:11:22] needed it. [00:11:24] And so the big uh unlocker for us was [00:11:27] this concept of a state bundle, a [00:11:29] context object of some kind [00:11:32] that we could have a process consume or [00:11:35] sorry, have a task consume [00:11:38] that would allow it to do things safely. [00:11:40] And so the overall arc of what you'll [00:11:42] see for the rest of this talk is being [00:11:44] able to identify coding patterns that [00:11:47] are uh not great in a shared use [00:11:49] environment like threads, [00:11:51] providing alternatives that are safe, [00:11:54] and then using deterministic and agentic [00:11:57] tooling to help do those migrations for [00:12:00] us, right? So in this example um [00:12:03] in a multi-threaded scenario, two [00:12:05] different projects um that use the same [00:12:08] relative path for an item, like a piece [00:12:10] of content in a project, [00:12:12] uh even if they are in different [00:12:14] projects and those projects are in [00:12:15] different physical locations in the file [00:12:17] system, [00:12:18] when MS Build resolves those paths in [00:12:21] multi-process, it uses the process path [00:12:24] or it uses the current working directory [00:12:26] if unspecified. [00:12:28] In a thread-based system, we needed a [00:12:30] way to isolate that and to say that this [00:12:32] thread is working on this project which [00:12:34] is hosted in this location, right? [00:12:36] So the idea would be to provide this [00:12:39] object that can insulate the task author [00:12:42] from the actual behavior of the engine. [00:12:44] Uh if you wanted to get super crazy, you [00:12:46] could imagine today we have the [00:12:48] multi-process MS Build and the [00:12:50] multi-threaded MS Build. With the safer [00:12:52] APIs that we have for task authors [00:12:54] today, we could invent a third mode [00:12:57] that and your task code wouldn't need to [00:12:59] change because you were already doing [00:13:00] safe things, right? So abstractions are [00:13:03] good. [00:13:04] Um in the new mode, like I said, [00:13:06] everything runs in the same process on [00:13:09] threads if possible, but for [00:13:10] compatibility, we needed to be able to [00:13:12] run tasks that have not been [00:13:14] enlightened. [00:13:16] And so we uh reused the uh task host, [00:13:19] the out-of-process task host mechanism [00:13:21] we already had to make these ephemeral [00:13:23] sidecar task hosts. So now over the [00:13:26] course of a build, if you need to run [00:13:28] tasks that are not multi-threaded, we [00:13:30] will spin up this task host, it will run [00:13:32] the tasks, we will communicate back and [00:13:34] forth with it, and at the end of the [00:13:36] build, that task host will be destroyed. [00:13:38] So there is still some startup cost for [00:13:42] um builds that don't use only uh [00:13:45] enlightened task, but we amortize that [00:13:47] and over time as we enlighten more and [00:13:50] more tasks, the need for this [00:13:52] compatibility mechanism will get much [00:13:54] lower. [00:13:56] So what does it look like to enlighten a [00:13:57] task and start participating in this [00:13:59] brave new world? [00:14:01] We're going to take a look at some [00:14:01] sample code here. This is a very simple [00:14:03] MS Build task that you could write [00:14:05] today. Uh there are using statements for [00:14:08] the MS Build libraries up at the top, [00:14:11] and then this task, all it does is count [00:14:13] the lines in a file. So it is passed an [00:14:16] input string that points to the source [00:14:18] file in question, and it outputs an [00:14:21] integer that is the count of lines in [00:14:23] that file. [00:14:24] Every task has to overwrite this execute [00:14:26] method, do something and return a [00:14:29] Boolean success or failure. [00:14:31] If you encounter errors or anything like [00:14:32] that, there are engine APIs for logging [00:14:35] those errors and so forth. But this is a [00:14:37] super simple task. We just use [00:14:39] system.io.file [00:14:40] to read all the lines from the source [00:14:42] file and then count them, right? It's [00:14:44] not incredibly inefficient. We're just [00:14:46] proving a point here. So this is the [00:14:48] most basic task and in multi-threaded [00:14:50] mode, we would have to spin up a task [00:14:53] host process and send a payload of [00:14:55] information to that process that says, [00:14:57] hey, here's this project context, here's [00:15:00] all your inputs, run your stuff and then [00:15:03] send me your outputs. And that's hugely [00:15:05] wasteful for something as slim as this [00:15:07] task. So let's make it multi-threaded [00:15:10] capable. [00:15:11] So today, if you update your MSBuild [00:15:14] packages, you will get access to two [00:15:17] things that are incredibly useful here. [00:15:19] The first is this multi MSBuild [00:15:21] multi-threadable task attribute. You [00:15:24] have to specify this attribute for [00:15:26] MSBuild to even run your task in process [00:15:29] in multi-threaded mode. We never do this [00:15:32] implicitly. It has to be an explicit [00:15:34] author decision. [00:15:36] And so this alone is all you need and if [00:15:38] you're not doing anything fancy in your [00:15:40] task, you may not need to execute or [00:15:42] even update much code to get this to [00:15:44] work. [00:15:45] But if you do need access to [00:15:47] process-level state, if you need to [00:15:50] absolutize some paths that may be [00:15:52] relative, or if you need to poem [00:15:54] environment variables, or if you need to [00:15:56] spawn a process correctly, those are all [00:15:59] things that the new task environment [00:16:01] structure can provide to you. And in [00:16:03] order to get access to that, you add [00:16:05] this I multi-threadable task interface [00:16:08] which gives you this structure and then [00:16:10] during your execute method, you can use [00:16:12] this structure to perform the operations [00:16:14] you need in a safe way regardless of the [00:16:17] MSBuild engines, uh, [00:16:19] execution mode. [00:16:20] So this is not just a good thing for MS [00:16:22] build. This is starting us on a road to [00:16:24] where we can provide more direct [00:16:26] guidance to task authors so that they [00:16:28] stay within the boundaries of what a [00:16:30] good task is, what a task that is safe [00:16:34] is, what a task that declares all of its [00:16:36] inputs and outputs correctly, and this [00:16:37] sort of thing. So this is the min bar [00:16:39] here. [00:16:40] I'm looking forward, and this is [00:16:43] actually a thing that is technically [00:16:44] possible today, and I encourage you to [00:16:46] try it out. [00:16:47] We can actually be even more declarative [00:16:49] here [00:16:50] because we know that the uh, source file [00:16:54] that we saw just one slide ago, it's not [00:16:56] just a string, it's actually a file. So [00:16:59] if we look at what is also possible with [00:17:02] the most uh, fresh and hot MS build [00:17:05] bits, you can actually do typed binding [00:17:08] now as well for your inputs and outputs. [00:17:10] So here we've replaced the string source [00:17:12] file with an I task item of file info, [00:17:15] and this does a few things for us. It [00:17:18] makes it very clear declaratively that [00:17:20] this thing should be a file, and it [00:17:23] makes it so that the engine is [00:17:25] responsible for doing any absolute path [00:17:27] calculations to correctly construct that [00:17:30] file info. So in this case, I've even [00:17:33] insulated myself even more from the [00:17:35] behavior of the engine by telling the [00:17:37] engine more about what I expect here. [00:17:40] Um, we support file info, we support [00:17:42] directory info, and we also support a [00:17:44] custom MS build structure called [00:17:46] absolute path [00:17:47] if you know that you're going to need to [00:17:49] do some file manipulations, uh, and just [00:17:52] want to take a sort of halfway step [00:17:54] there. [00:17:55] But if you lean into this typed binding, [00:17:57] you can see that the implementation [00:17:59] becomes even more amenable. We have our [00:18:02] absolute source file already. We can [00:18:04] just get the full path to it. We can [00:18:05] read the lines directly and count them. [00:18:07] We could also use anything, uh, any of [00:18:10] the built-in uh, file info, open read, [00:18:12] etc. methods off of the source file. [00:18:16] But the whole point here is to start us [00:18:17] on a more declarative path where task [00:18:20] authors can tell the engine more about [00:18:22] how they want to use these inputs and [00:18:24] outputs so that the engine can take more [00:18:26] of the boilerplate and load away. I'm [00:18:28] I'm pretty proud of this. I expect us to [00:18:31] continue to lean into it more. [00:18:34] But how do you know to even use all of [00:18:36] this stuff? Well, I'm also happy to let [00:18:39] you all know that we've started [00:18:40] publishing Roslyn analyzers to help task [00:18:42] authors do the right thing. [00:18:45] Some of the there are [00:18:47] I think 12 different rules in the [00:18:50] analyzer today, some of which are [00:18:52] specific to multi-threaded tasks, but [00:18:54] many of them are just good hygiene for [00:18:56] task authors overall. You can add a [00:18:58] package reference to your task-carrying [00:19:01] libraries today. [00:19:03] Make sure and add private assets as is [00:19:05] specified here because this is a [00:19:07] build-time only package. And then you [00:19:09] can light up all of the analyzers with a [00:19:12] single editor config and manage their [00:19:14] different severities exactly the same as [00:19:16] you would with any other Roslyn [00:19:17] analyzer. [00:19:18] And these analyzers will help flag [00:19:21] problematic APIs, like spawning [00:19:23] processes yourself or doing manual file [00:19:26] IO [00:19:27] or file path traversals and that sort of [00:19:29] thing, and guide you towards the safe [00:19:33] variants of those. [00:19:35] We will continue expanding this a little [00:19:37] bit more each release. [00:19:39] We plan to add fixers for many of the [00:19:42] most common issues. [00:19:44] But yeah, this is this is I think the [00:19:46] start of much more tooling-assisted MS [00:19:49] build experiences, and I'm excited for [00:19:51] you all to try it out and give us [00:19:52] feedback about how they work on your [00:19:54] tasks. [00:19:56] But deterministic help is only part of [00:19:58] the story here. [00:20:00] We are well aware that the agentic [00:20:02] revolution is [00:20:04] is the road that we're all on right now. [00:20:06] And so we also have a plugin in the repo [00:20:08] that we have been using to help migrate [00:20:11] many of the tasks that are baked into [00:20:13] the .NET SDK or shipped with MS build or [00:20:16] exist in partner team products. [00:20:19] This is something that is out there. We [00:20:21] are continuously iterating on it. [00:20:23] It will for you too. Um, we would also [00:20:25] love to have you all try it and to give [00:20:27] us feedback. Like all of these [00:20:29] diagnostic tools, like all of these [00:20:31] analyzers, everything is in a constant [00:20:33] state of improvement. So the more people [00:20:36] try this and the more people migrate [00:20:37] their tasks to multi-threaded, the [00:20:39] better the overall system will get. [00:20:41] And as I mentioned before, [00:20:43] the more tasks that are enlightened, the [00:20:46] better the overall effect is, right? [00:20:49] Many of the projects in Orchard Core are [00:20:52] web projects. Many of them do packaging [00:20:54] as part of build and this kind of thing. [00:20:56] There are entire swaths of the build [00:20:58] that we have not yet enlightened, and [00:21:00] we're already seeing these numbers. We [00:21:02] have an uh public performance dashboards [00:21:05] uh over at aka.ms/ [00:21:09] or msbuild/performance dashboard that we [00:21:11] use to track uh how these things work [00:21:14] over time. And y'all, the lines are [00:21:17] amazing. I love watching the trend [00:21:19] lines. They just go up and to the right [00:21:20] and down into the right as appropriate [00:21:23] uh as we enlighten more tasks, right? [00:21:26] Um, there are a number of other sort of [00:21:29] ancillary benefits that we found from [00:21:31] doing this whole msbuild multi-threaded [00:21:33] migration as well. [00:21:35] As we move more tasks in process and as [00:21:38] more worker threads are working in the [00:21:40] same process, we find areas of [00:21:43] contention in the engine itself. And [00:21:46] when we are able to target those areas [00:21:47] of contention, we sometimes find that [00:21:49] even normal msbuild gets better. [00:21:52] We have a fix that is not NGA but will [00:21:55] be coming in the the winter release [00:21:57] that uh [00:21:59] fixes or improves the performance of [00:22:01] that IPC mechanism I was talking about, [00:22:04] uh especially for binlog messages. And [00:22:06] as a result, you see fairly significant [00:22:09] uh reductions in the normal msbuild [00:22:11] build times for some projects. [00:22:14] Multi-threaded is still much better, but [00:22:16] this is just proof to me that [00:22:19] having everything in one process, making [00:22:20] it easier to profile, making it easier [00:22:23] to diagnose with standard .NET tools [00:22:25] like uh .NET Trace and .NET counters is [00:22:29] nothing but goodness for the entire [00:22:30] MSBuild ecosystem. [00:22:32] Aside from multi-threaded build, we do [00:22:34] have a number of other [00:22:36] threads going on. We're working with the [00:22:38] DevKit team to try and find and [00:22:42] find ways that we can maybe not do [00:22:44] entire builds if we don't need to, [00:22:46] right? Many of the learnings that you [00:22:47] just heard about are core fundamentals [00:22:49] that are good for any build system. [00:22:51] Inside Microsoft, we are working on ways [00:22:54] to optimize our own usage of MSBuild, [00:22:57] ideally in ways that we can also [00:22:59] allow third parties to plug into as well [00:23:02] because builds, especially the CI [00:23:04] builds, are the ones that tend to take [00:23:07] the longest and the ones that we find [00:23:09] ourselves using more and more. [00:23:11] The the programming pattern we are [00:23:12] seeing more and more is narrow inner [00:23:14] loops focused on the agents and then [00:23:16] doing the long exhaustive validations in [00:23:19] CI. So it's [00:23:21] kind of trying to serve both here, [00:23:23] multi-threaded mode is, [00:23:25] both on the inner loops as well as the [00:23:27] cold builds in CI. [00:23:30] That's essentially the gist of it. All [00:23:33] of this is stuff that is available for [00:23:35] you to try right now, right? We are [00:23:37] confident in the correctness of the [00:23:39] mechanism. We've done extensive testing [00:23:41] across our build. In fact, we rolled out [00:23:44] multi-threaded MSBuild to the .NET .NET [00:23:46] VMR, the virtual mono repo that we [00:23:49] actually use to build and publish the [00:23:50] product now since .NET 10, and it [00:23:53] resulted in, I believe, upwards of 20 [00:23:55] minutes of savings for some of our long [00:23:57] pole builds just with this one flag. And [00:24:00] as I mentioned before, there are still a [00:24:03] long tail of tasks that we can [00:24:05] enlighten, so that number will get [00:24:06] better. And that says nothing about [00:24:08] fundamental changes to the build logic [00:24:10] that we want to do. [00:24:12] We have teams looking at ways to change [00:24:15] the way the build works so that we do [00:24:18] not change the inputs and outputs of a [00:24:20] build as frequently, which lets us reuse [00:24:23] them more often, do less work, and spend [00:24:26] less time overall, right? So everyone [00:24:28] here at Microsoft is intensely focused [00:24:30] on the overall tooling experience from [00:24:33] raw builds to exploring ways of not [00:24:35] doing builds to exploring ways of uh [00:24:38] caching. It's it's a big focus for us [00:24:42] and this multi-threaded aspect is one of [00:24:44] our first salvos tackling the problem [00:24:46] overall. Go try it. Let us know how you [00:24:49] feel about it. Let us know how what kind [00:24:51] of results you have for both the [00:24:53] analyzers and the skills and together [00:24:55] we'll make this thing super polished for [00:24:57] the on by default switch in 110200 and [00:25:01] beyond. [00:25:03] Uh there are a few resources here that [00:25:06] if folks want to go look at them, we [00:25:07] have migration guides for authors that [00:25:09] you can point agents at. We have the [00:25:11] skills and the analyzer package as I [00:25:13] mentioned and there's also a link here [00:25:15] that you can go to see that performance [00:25:17] dashboard I mentioned so that you can [00:25:19] follow along with the same progress that [00:25:21] we are having. This is this is our truth [00:25:24] right here. The ASP.NET team has the [00:25:26] dashboard that they've used for years to [00:25:29] track things like um the what used to be [00:25:31] the old Tech and Power Benchmarks and [00:25:32] other micro benchmarks. This is our [00:25:35] truth now too. So follow along with us. [00:25:37] Um we have ways of doing experimental [00:25:40] builds to see how they stack up as well. [00:25:42] So if optimizing build performance is [00:25:45] something you're interested in, [00:25:46] go to the MS Build Repo, fork it, try [00:25:49] out your experiments and we will help [00:25:50] you get a perf build going so you can [00:25:52] see how it works in the real world. [00:25:55] So that's about it.