Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. So...what's .NET doing, exactly?

So...what's .NET doing, exactly?

Scheduled Pinned Locked Moved The Lounge
csharpvisual-studiotoolsquestionannouncement
17 Posts 13 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dandy72
    wrote on last edited by
    #1

    After installing an update to VS, I mean. Right now, I just updated to 17.5.4 (released earlier this week) from the previous 17.5.3. Without fail, every time Visual Studio gets updated (I'm on 2022, but saw the same with previous versions), Task Manager shows many, many instances of mscorsvw.exe launching and running one after another--sequentially, not in parallel--for mere seconds each (< 2 seconds on average). It's actually a bit difficult to visualize with Task Manager as you might not even spot much going on, except that on each refresh the process (mscorsvw.exe) has a new PID and args, which means an instance has shut down, and a brand new one has started. I actually wrote a utility a while ago to log all process launches and shut downs, with full command-line args, etc, and right now - about an hour after the VS update process itself has completed and exited - I'm looking at over 800 instances of that process that have launched/closed (and still counting), each with params such as:

    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorsvw.exe -StartupEvent d80 -InterruptEvent 0 -NGENProcess d04 -Pipe d00 -Comment ""NGen Worker Process""

    I realize this is one of those things that ultimately are "normal" and entirely to be expected (don't worry your pretty little head, after all, just let MS do its thing), but I'm just curious, if nothing else but for the fact that it seems excessive. I don't recall ever seeing any article or blog entry discussing what's going on during that phase. [Unrelated: My utility demonstrates Win10 is consistently launching/closing roughly 10x more processes on their own, 24/7, than any predecessor ever did in the same amount of time. For all its progress in power-saving claims, this seems counterproductive. Again, why should anyone care? I'm not sure. I'm just sharing the observation...]

    D 0 K C J 6 Replies Last reply
    0
    • D dandy72

      After installing an update to VS, I mean. Right now, I just updated to 17.5.4 (released earlier this week) from the previous 17.5.3. Without fail, every time Visual Studio gets updated (I'm on 2022, but saw the same with previous versions), Task Manager shows many, many instances of mscorsvw.exe launching and running one after another--sequentially, not in parallel--for mere seconds each (< 2 seconds on average). It's actually a bit difficult to visualize with Task Manager as you might not even spot much going on, except that on each refresh the process (mscorsvw.exe) has a new PID and args, which means an instance has shut down, and a brand new one has started. I actually wrote a utility a while ago to log all process launches and shut downs, with full command-line args, etc, and right now - about an hour after the VS update process itself has completed and exited - I'm looking at over 800 instances of that process that have launched/closed (and still counting), each with params such as:

      C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorsvw.exe -StartupEvent d80 -InterruptEvent 0 -NGENProcess d04 -Pipe d00 -Comment ""NGen Worker Process""

      I realize this is one of those things that ultimately are "normal" and entirely to be expected (don't worry your pretty little head, after all, just let MS do its thing), but I'm just curious, if nothing else but for the fact that it seems excessive. I don't recall ever seeing any article or blog entry discussing what's going on during that phase. [Unrelated: My utility demonstrates Win10 is consistently launching/closing roughly 10x more processes on their own, 24/7, than any predecessor ever did in the same amount of time. For all its progress in power-saving claims, this seems counterproductive. Again, why should anyone care? I'm not sure. I'm just sharing the observation...]

      D Offline
      D Offline
      Dan Neely
      wrote on last edited by
      #2

      NGEN is a tool that takes .net code, compiles it to native, so it can be cached for reuse. Assuming it eventually stops happening, VS is background precompiling all the shiny new .net code you've got from MSIL to native binaries. [Ngen.exe (Native Image Generator) - .NET Framework | Microsoft Learn](https://learn.microsoft.com/en-us/dotnet/framework/tools/ngen-exe-native-image-generator)

      Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius

      D 1 Reply Last reply
      0
      • D Dan Neely

        NGEN is a tool that takes .net code, compiles it to native, so it can be cached for reuse. Assuming it eventually stops happening, VS is background precompiling all the shiny new .net code you've got from MSIL to native binaries. [Ngen.exe (Native Image Generator) - .NET Framework | Microsoft Learn](https://learn.microsoft.com/en-us/dotnet/framework/tools/ngen-exe-native-image-generator)

        Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius

        D Offline
        D Offline
        dandy72
        wrote on last edited by
        #3

        [For argument's sake] But the VS binaries I downloaded can only run on x86 anyway. Why are the binaries I downloaded *not* already precompiled as native x86, and save *everyone* that extra step?

        J S D G A 5 Replies Last reply
        0
        • D dandy72

          After installing an update to VS, I mean. Right now, I just updated to 17.5.4 (released earlier this week) from the previous 17.5.3. Without fail, every time Visual Studio gets updated (I'm on 2022, but saw the same with previous versions), Task Manager shows many, many instances of mscorsvw.exe launching and running one after another--sequentially, not in parallel--for mere seconds each (< 2 seconds on average). It's actually a bit difficult to visualize with Task Manager as you might not even spot much going on, except that on each refresh the process (mscorsvw.exe) has a new PID and args, which means an instance has shut down, and a brand new one has started. I actually wrote a utility a while ago to log all process launches and shut downs, with full command-line args, etc, and right now - about an hour after the VS update process itself has completed and exited - I'm looking at over 800 instances of that process that have launched/closed (and still counting), each with params such as:

          C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorsvw.exe -StartupEvent d80 -InterruptEvent 0 -NGENProcess d04 -Pipe d00 -Comment ""NGen Worker Process""

          I realize this is one of those things that ultimately are "normal" and entirely to be expected (don't worry your pretty little head, after all, just let MS do its thing), but I'm just curious, if nothing else but for the fact that it seems excessive. I don't recall ever seeing any article or blog entry discussing what's going on during that phase. [Unrelated: My utility demonstrates Win10 is consistently launching/closing roughly 10x more processes on their own, 24/7, than any predecessor ever did in the same amount of time. For all its progress in power-saving claims, this seems counterproductive. Again, why should anyone care? I'm not sure. I'm just sharing the observation...]

          0 Offline
          0 Offline
          0x01AA
          wrote on last edited by
          #4

          *lol* before a decade (and more) one complained about the dll hell. Nowadays I have the strange feeling it became much worst... ... VS which one now? ... .NET x/y/z/core this and that, which one now? ... Nuget I changed here and there :wtf:

          T J 2 Replies Last reply
          0
          • D dandy72

            [For argument's sake] But the VS binaries I downloaded can only run on x86 anyway. Why are the binaries I downloaded *not* already precompiled as native x86, and save *everyone* that extra step?

            J Offline
            J Offline
            jschell
            wrote on last edited by
            #5

            dandy72 wrote:

            Why are the binaries I downloaded not already precompiled as native x86,

            Some guesses... It is including security info which is specific to the machine itself. Although the OS is conceptually the same it is actually different on different machines. Some some potential compilations might produce different outcomes. It doesn't just compile but also installs them. That can vary by machine. It is just easier for them to do it this way in case any of the above is true or might be true. Maybe only for a couple of actual deployed units.

            1 Reply Last reply
            0
            • D dandy72

              After installing an update to VS, I mean. Right now, I just updated to 17.5.4 (released earlier this week) from the previous 17.5.3. Without fail, every time Visual Studio gets updated (I'm on 2022, but saw the same with previous versions), Task Manager shows many, many instances of mscorsvw.exe launching and running one after another--sequentially, not in parallel--for mere seconds each (< 2 seconds on average). It's actually a bit difficult to visualize with Task Manager as you might not even spot much going on, except that on each refresh the process (mscorsvw.exe) has a new PID and args, which means an instance has shut down, and a brand new one has started. I actually wrote a utility a while ago to log all process launches and shut downs, with full command-line args, etc, and right now - about an hour after the VS update process itself has completed and exited - I'm looking at over 800 instances of that process that have launched/closed (and still counting), each with params such as:

              C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorsvw.exe -StartupEvent d80 -InterruptEvent 0 -NGENProcess d04 -Pipe d00 -Comment ""NGen Worker Process""

              I realize this is one of those things that ultimately are "normal" and entirely to be expected (don't worry your pretty little head, after all, just let MS do its thing), but I'm just curious, if nothing else but for the fact that it seems excessive. I don't recall ever seeing any article or blog entry discussing what's going on during that phase. [Unrelated: My utility demonstrates Win10 is consistently launching/closing roughly 10x more processes on their own, 24/7, than any predecessor ever did in the same amount of time. For all its progress in power-saving claims, this seems counterproductive. Again, why should anyone care? I'm not sure. I'm just sharing the observation...]

              K Offline
              K Offline
              Kin Bueno 2023
              wrote on last edited by
              #6

              Not at all bool space, are construe to constructs are pre-defined metadata as deviation to computer science rules in IE 6 or java 3.2 and above. Cryphos negative .net expertise on wailu and saliba

              1 Reply Last reply
              0
              • 0 0x01AA

                *lol* before a decade (and more) one complained about the dll hell. Nowadays I have the strange feeling it became much worst... ... VS which one now? ... .NET x/y/z/core this and that, which one now? ... Nuget I changed here and there :wtf:

                T Offline
                T Offline
                TNCaver
                wrote on last edited by
                #7

                It merely morphed from DLL hell into NuGet hell.

                There are no solutions, only trade-offs.
                   - Thomas Sowell

                A day can really slip by when you're deliberately avoiding what you're supposed to do.
                   - Calvin (Bill Watterson, Calvin & Hobbes)

                1 Reply Last reply
                0
                • D dandy72

                  After installing an update to VS, I mean. Right now, I just updated to 17.5.4 (released earlier this week) from the previous 17.5.3. Without fail, every time Visual Studio gets updated (I'm on 2022, but saw the same with previous versions), Task Manager shows many, many instances of mscorsvw.exe launching and running one after another--sequentially, not in parallel--for mere seconds each (< 2 seconds on average). It's actually a bit difficult to visualize with Task Manager as you might not even spot much going on, except that on each refresh the process (mscorsvw.exe) has a new PID and args, which means an instance has shut down, and a brand new one has started. I actually wrote a utility a while ago to log all process launches and shut downs, with full command-line args, etc, and right now - about an hour after the VS update process itself has completed and exited - I'm looking at over 800 instances of that process that have launched/closed (and still counting), each with params such as:

                  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorsvw.exe -StartupEvent d80 -InterruptEvent 0 -NGENProcess d04 -Pipe d00 -Comment ""NGen Worker Process""

                  I realize this is one of those things that ultimately are "normal" and entirely to be expected (don't worry your pretty little head, after all, just let MS do its thing), but I'm just curious, if nothing else but for the fact that it seems excessive. I don't recall ever seeing any article or blog entry discussing what's going on during that phase. [Unrelated: My utility demonstrates Win10 is consistently launching/closing roughly 10x more processes on their own, 24/7, than any predecessor ever did in the same amount of time. For all its progress in power-saving claims, this seems counterproductive. Again, why should anyone care? I'm not sure. I'm just sharing the observation...]

                  C Offline
                  C Offline
                  Calin Negru
                  wrote on last edited by
                  #8

                  I always thought a question like this is a newbish thing to ask but it’s not. To figure it out you have to know something about what Windows does internally in the first place

                  1 Reply Last reply
                  0
                  • D dandy72

                    [For argument's sake] But the VS binaries I downloaded can only run on x86 anyway. Why are the binaries I downloaded *not* already precompiled as native x86, and save *everyone* that extra step?

                    S Offline
                    S Offline
                    Shao Voon Wong
                    wrote on last edited by
                    #9

                    There are ARM versions of Visual Studio. And even on the Intel x86 architecture, there are newer and faster instructions to take advantage of. Or you prefer to be like C++; their generated instructions stick to archaic and minimum 80x686 instructions.

                    D 1 Reply Last reply
                    0
                    • D dandy72

                      After installing an update to VS, I mean. Right now, I just updated to 17.5.4 (released earlier this week) from the previous 17.5.3. Without fail, every time Visual Studio gets updated (I'm on 2022, but saw the same with previous versions), Task Manager shows many, many instances of mscorsvw.exe launching and running one after another--sequentially, not in parallel--for mere seconds each (< 2 seconds on average). It's actually a bit difficult to visualize with Task Manager as you might not even spot much going on, except that on each refresh the process (mscorsvw.exe) has a new PID and args, which means an instance has shut down, and a brand new one has started. I actually wrote a utility a while ago to log all process launches and shut downs, with full command-line args, etc, and right now - about an hour after the VS update process itself has completed and exited - I'm looking at over 800 instances of that process that have launched/closed (and still counting), each with params such as:

                      C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorsvw.exe -StartupEvent d80 -InterruptEvent 0 -NGENProcess d04 -Pipe d00 -Comment ""NGen Worker Process""

                      I realize this is one of those things that ultimately are "normal" and entirely to be expected (don't worry your pretty little head, after all, just let MS do its thing), but I'm just curious, if nothing else but for the fact that it seems excessive. I don't recall ever seeing any article or blog entry discussing what's going on during that phase. [Unrelated: My utility demonstrates Win10 is consistently launching/closing roughly 10x more processes on their own, 24/7, than any predecessor ever did in the same amount of time. For all its progress in power-saving claims, this seems counterproductive. Again, why should anyone care? I'm not sure. I'm just sharing the observation...]

                      J Offline
                      J Offline
                      Jeremy Falcon
                      wrote on last edited by
                      #10

                      dandy72 wrote:

                      I'm looking at over 800 instances of that process

                      Not sure if this is a bug or not, but either way VS is bloatware now. It should not take 40GB+ or whatever it is for an IDE.

                      Jeremy Falcon

                      1 Reply Last reply
                      0
                      • 0 0x01AA

                        *lol* before a decade (and more) one complained about the dll hell. Nowadays I have the strange feeling it became much worst... ... VS which one now? ... .NET x/y/z/core this and that, which one now? ... Nuget I changed here and there :wtf:

                        J Offline
                        J Offline
                        Jeremy Falcon
                        wrote on last edited by
                        #11

                        The end of DLL hell was a sales pitch. Different names these days. Same principle.

                        Jeremy Falcon

                        1 Reply Last reply
                        0
                        • D dandy72

                          [For argument's sake] But the VS binaries I downloaded can only run on x86 anyway. Why are the binaries I downloaded *not* already precompiled as native x86, and save *everyone* that extra step?

                          D Offline
                          D Offline
                          Dan Neely
                          wrote on last edited by
                          #12

                          anything vectorizable would have a bunch of versions depending on how new your CPU is. Older CPUs also need extra defensive programming around speculative execution exploits. In theory they still could have precompiled binaries, but it's a lot more than just: x86, x64, or ARM?

                          Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius

                          1 Reply Last reply
                          0
                          • S Shao Voon Wong

                            There are ARM versions of Visual Studio. And even on the Intel x86 architecture, there are newer and faster instructions to take advantage of. Or you prefer to be like C++; their generated instructions stick to archaic and minimum 80x686 instructions.

                            D Offline
                            D Offline
                            dandy72
                            wrote on last edited by
                            #13

                            Shao Voon Wong wrote:

                            There are ARM versions of Visual Studio.

                            And how many people even have access to that, outside of MS?

                            1 Reply Last reply
                            0
                            • D dandy72

                              After installing an update to VS, I mean. Right now, I just updated to 17.5.4 (released earlier this week) from the previous 17.5.3. Without fail, every time Visual Studio gets updated (I'm on 2022, but saw the same with previous versions), Task Manager shows many, many instances of mscorsvw.exe launching and running one after another--sequentially, not in parallel--for mere seconds each (< 2 seconds on average). It's actually a bit difficult to visualize with Task Manager as you might not even spot much going on, except that on each refresh the process (mscorsvw.exe) has a new PID and args, which means an instance has shut down, and a brand new one has started. I actually wrote a utility a while ago to log all process launches and shut downs, with full command-line args, etc, and right now - about an hour after the VS update process itself has completed and exited - I'm looking at over 800 instances of that process that have launched/closed (and still counting), each with params such as:

                              C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorsvw.exe -StartupEvent d80 -InterruptEvent 0 -NGENProcess d04 -Pipe d00 -Comment ""NGen Worker Process""

                              I realize this is one of those things that ultimately are "normal" and entirely to be expected (don't worry your pretty little head, after all, just let MS do its thing), but I'm just curious, if nothing else but for the fact that it seems excessive. I don't recall ever seeing any article or blog entry discussing what's going on during that phase. [Unrelated: My utility demonstrates Win10 is consistently launching/closing roughly 10x more processes on their own, 24/7, than any predecessor ever did in the same amount of time. For all its progress in power-saving claims, this seems counterproductive. Again, why should anyone care? I'm not sure. I'm just sharing the observation...]

                              B Offline
                              B Offline
                              Bernie B
                              wrote on last edited by
                              #14

                              this helps: Fix: High CPU Usage by .NET Runtime Optimization Service[^]

                              1 Reply Last reply
                              0
                              • D dandy72

                                [For argument's sake] But the VS binaries I downloaded can only run on x86 anyway. Why are the binaries I downloaded *not* already precompiled as native x86, and save *everyone* that extra step?

                                G Offline
                                G Offline
                                gt2847c
                                wrote on last edited by
                                #15

                                Another thing to consider... Just because the VS Installer is pulling the packages and running the install for you, the .NET packages are available separately and cover multiple platforms. The packages themselves are not all VS and platform specific...

                                1 Reply Last reply
                                0
                                • D dandy72

                                  [For argument's sake] But the VS binaries I downloaded can only run on x86 anyway. Why are the binaries I downloaded *not* already precompiled as native x86, and save *everyone* that extra step?

                                  A Offline
                                  A Offline
                                  Andre_Prellwitz
                                  wrote on last edited by
                                  #16

                                  The code is compiled to IL, just not JIT-compiled to machine code. NGEN does this ahead of time (AoT) to improve startup performance at the expense of disk space, assuming disk reads are much quicker than JIT compilation. This also saves time and bandwidth transferring only the IL from Microsoft.

                                  T 1 Reply Last reply
                                  0
                                  • A Andre_Prellwitz

                                    The code is compiled to IL, just not JIT-compiled to machine code. NGEN does this ahead of time (AoT) to improve startup performance at the expense of disk space, assuming disk reads are much quicker than JIT compilation. This also saves time and bandwidth transferring only the IL from Microsoft.

                                    T Offline
                                    T Offline
                                    trønderen
                                    wrote on last edited by
                                    #17

                                    In principle, it could even start executing the code up until the first point where it was dependent on something outside the image, and freeze that as a modified starting image. If the initializing code executed had no external references, it could be peeled off, once it was executed. I doubt that it is doing that, although it would be possible.

                                    1 Reply Last reply
                                    0
                                    Reply
                                    • Reply as topic
                                    Log in to reply
                                    • Oldest to Newest
                                    • Newest to Oldest
                                    • Most Votes


                                    • Login

                                    • Don't have an account? Register

                                    • Login or register to search.
                                    • First post
                                      Last post
                                    0
                                    • Categories
                                    • Recent
                                    • Tags
                                    • Popular
                                    • World
                                    • Users
                                    • Groups