memory-efficient
Need help in developing DB logic
Don’t use “smart keys”. This is a bad idea called “smart keys” or “encoding information in keys”. See this answer which contains this excerpt: Despite it now being easy to implement a Smart Key, it is hard to recommend that you create one of your own that isn’t a natural key, because they tend to … Read more
Parallel.ForEach memory usage keeps growing
The Parallel.ForEach method is intended for parallelizing CPU-bound workloads. Downloading a file is an I/O bound workload, and so the Parallel.ForEach is not ideal for this case because it needlessly blocks ThreadPool threads. The correct way to do it is asynchronously, with async/await. The recommended class for making asynchronous web requests is the HttpClient, and … Read more
What are the benefits to marking a field as `readonly` in C#?
I don’t believe there are any performance gains from using a readonly field. It’s simply a check to ensure that once the object is fully constructed, that field cannot be pointed to a new value. However “readonly” is very different from other types of read-only semantics because it’s enforced at runtime by the CLR. The … Read more