question

meghanachitta-8509 avatar image
0 Votes"
meghanachitta-8509 asked JackJJun-MSFT commented

How can I write carbon effiecient c# code without compromising on perfromance?

I am wondering if there are any examples as to learn how to incorporate sustainable software development. I am a .NET developer and looking for resources that guide me on how I can develop applications using .NET core / C# that are carbon efficient and contribute to climate change.

dotnet-csharp
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Can you clarify the question? What is carbon efficient code and how do you measure carbon efficient code? Can you explain how writing carbon efficient code compromises performance? Performance of what?

Keep in mind, your development machine uses electrical power. Go solar, I did, then your development machine is running off solar power while the sun is shining. I'm writing this post using a machine powered by the sun.

Maybe are you looking for a project?

1 Vote 1 ·

@meghanachitta-8509 ,your question seems to be board, can you describe your problem in more detail or give an example to show what you are looking for about the carbon?

0 Votes 0 ·

1 Answer

karenpayneoregon avatar image
0 Votes"
karenpayneoregon answered

There are several things to consider for efficient code

  • The developer's knowledge, with limited knowledge one can not know what to look for and there is no tried and true pattern that works for every application in regards to code.

  • What type of project, the environment and hardware.

  • Knowing the cost of using any framework homebrewed or third party

  • Using libraries such as Benchmarkdotnet to bench mark code

  • Load testing which we do on all web applications that are outfacing to the entire state of Oregon

  • Measure app performance in Visual Studio

And one must not just started coding with only a vision, write out your requirements, work in iterations and with each task in a iteration check performance along with writing unit test.

Something I do is not always look for one-liners or libraries that promise this and that without knowing what their footprint is.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.