Cross compilation of .NET project on faster machine

Viewed 67

I'm sure I'm not the only one who has been thinking about trying this, but I haven't really seen anyone discuss it. Let me explain: I work from home sitting in front of my own personal desktop PC. I RDP into my Windows laptop, running a decent i7 10th gen with 6 cores and 12 threads. However, my desktop is far better with an i9-12900K, and it completely dominates my work laptop, when it comes to compiling.

However, because of network rules and such, I cannot develop using my desktop PC at home, because my PC isn't on the same network (my work laptop is connected to a VPN). If I actually do run the project, I cannot connect to anything.

Therefore I was thinking, if it was possible to develop on the laptop, as I am doing right now, but whenever I want to compile, build, run with debugging enabled, and so on, all of that is handled on my desktop PC instead. It would speed up compilation time by a lot, which means I can develop faster and not wait for my IDE to respond.

Is something like this feasible? I'm guessing no, because of the complexity, but something like press build on work laptop -> PC at home builds -> PC at home ships binaries, DLLs, etc. back to work laptop -> work laptop starts debugger should be doable.. but it's probably not something anyone has tried, because it sounds stupid.

EDIT: I should also clarify: We should not be running the code on our home machines. The company owns the code and its IP, and in some countries and areas, it would probably be considered stealing, if you have the code on your own machine. We will not be using our home PCs to cross compile, but rather something in Azure or in our local datacenter, just to remove as much stress from our laptops as possible.

1 Answers

There are several systems for remote or distributed compiling, everything from commercial systems to hand made scripts that launch the compiler directly on the remote host.

It is however quite questionable if it would be worth the effort. Consider

  1. Any kind of remote compiling will introduce additional overhead to transfer changes and results.
  2. C# code is quite fast to compile, at least compared to c++.
  3. Concurrency is usually limited to the number of non-dependent projects, and may be bottle necked by other factors.
  4. Azure or other cloud providers are quite expensive once you specify larger amount of memory and CPU.
  5. Laptops are fairly cheap
  6. Any kind of network dependency will introduce an additional point of failure, people will not be happy if the internet goes down and cannot compile.
  7. Any kind of complex system needs someone to baby and fix any issues that occur. Local compilation usually just works
  8. Servers usually have lower clockspeed than desktop/laptops, so compilation of a single project might even be slower than on your laptop.

I worked at a company that bought some large, expensive, servers to reduce compilation times, as well as a wrote a bunch of scripts that made it all work. It mostly worked well, except when nearing release and everyone worked frantically and the servers became overloaded, with longer compilation times as a result. And I'm doubtful if it was actually cheaper in the end than just buying better computers.

So I would recommend starting by asking for a new laptop/desktop, that will be a far smaller investment, and should let you check how much improvement you actually get.

Related