
Tracking an error in my game, stressing over a fix, and the code to replace it all
Tracking an error in my game, stressing over a fix, and the code to replace it all
C++ requires many algorithms to be implemented in amortized constant time. I was curious about what this meant for vector insertion. To get started I first wrote an article about amortized time […]
Concurrent programming requires synchronization. We can’t have more than one thread accessing data at the same time; otherwise, we end up with a data race. The most common solution is to wrap […]
“Reference counting is slower than garbage collection”, a claim often made in the discussion of memory management. I heard it again recently when discussing Leaf; somebody took issue with my arguments against […]
Reference counting is a common form of memory management. In some languages, like Python, it’s the natural way objects are tracked, and in others it’s in the standard library, such as shared_ptr […]
The platform as a service model adds new importance to the performance of our software. Despite ever decreasing hardware costs, metered services make every bit count. My previous article on performance touched […]
Rectangles appear everywhere in user interfaces, from the backgrounds of elements to rounded border decorations. It’s helpful to be able to draw these fast. I set out to draw a rectangle with […]
Amortized time is often used when stating algorithm complexity. Instead of giving values for worst-case performance it provides an average performance. This is appropriate in many domains, but we must be careful. […]
To support a low-latency trading system I needed a logging call that had minimal impact on the calling thread. It was imperative to be responsive to market events at all times. My […]
Exceptions are a cornerstone of programming. If we intend to use them prolifically, as in C++, we need an efficient implementation. Thus was born the zero-cost exception model. It offers zero runtime […]
Beware the casual performance test, it will lie to you. It is simple to write something that gives you timings, but it is difficult to make those timings meaningful. A whole host […]
Asking questions about performance online universally invites scorn and accusation. A large number of programmers apparently feel that the efficiency of code is nowadays insignificant. So long as the functional requirements have […]
In the article on “How Polymorphism Works: Part 1” we learned how to create virtual functions. The method which we chose has at one significant problem with it: it requires a lot […]
Polymorphism: the core of object oriented programming. Most modern languages have some concept of interfaces, virtual functions, and classes. Though each language differs in details, and may have specialized concepts, the core […]