background preloader

Application Design

Facebook Twitter

OOP

Creating objects - Perf implications. Here are a few examples of how we can create objects, and the perf implications of each way.

Creating objects - Perf implications

In all those tests, I have used the following class as my benchmark. public class Created{ public int Num; public string Name; public Created(int num, string name) { this.Num = num; this.Name = name; }} We have a value type and a reference type that are passed to the constructor. The test code is here: static void Main(string[] args){ int iterations = 1000000; Stopwatch watch = Stopwatch.StartNew(); for (int i = 0; i < iterations; i++) { CreateInstance(i); } Console.WriteLine(watch.Elapsed);}

Dependency Injection

DDD. CAP Theorem. High performance. High Availibility. Architecture. Fault tolerance. Scalability. Event Driven Architecture. CQRS.