WriteAsync .NET

Testing, coding, in that order.

Building an adventure game: part 2

Previously, I recounted day 1 of my adventure game project. Let’s continue. Day 2 This was a short day. First I observe that it isn’t really necessary for the caller of Game to pass the MessageBus, so I change that.…

By Brian Rogers | 16 December, 2018 | design, tdd | 1 Comment |
Read more

Building an adventure game: part 1

I have written before about my early experiences with text adventure games and about how I built a GW-BASIC translator to convert one such example game to C#. It was a fun challenge but was admittedly more of a compiler…

By Brian Rogers | 9 December, 2018 | design, tdd | 1 Comment |
Read more

A simple message bus: Java edition

In the previous post, we looked at competing message bus implementations in C# and C++. How about we give Java a try now? Converting to Java syntax and style conventions, the SendOneSubscriber test should look like this: Alas, there is…

By Brian Rogers | 2 December, 2018 | design, performance | No Comments |
Read more

A simple message bus

The message bus is a typical pattern to allow loosely coupled software components to communicate, usually in an event-driven manner. Don’t let the enterprise-y description deter you — a simple message bus for a single process scenario can be quite…

By Brian Rogers | 25 November, 2018 | design, native, performance | 2 Comments |
Read more

Even more performance experiments: queues and threads

Last time, we concluded that a simple producer/consumer pattern using BlockingCollection topped out at around 2200K items per second. But the profiler revealed that the Throttle itself was one major contributor to the total CPU time. Let’s first address this…

By Brian Rogers | 18 November, 2018 | concurrency, performance, testing | No Comments |
Read more

More performance experiments: queues and threads

Continuing from our previous performance experiment, I would like to see if there are any easy optimizations to apply to squeeze more throughput out of this producer/consumer queue. One possible angle of attack is to replace the implicit synchronization primitives…

By Brian Rogers | 11 November, 2018 | concurrency, performance, testing | 1 Comment |
Read more

Performance experiments: queues and threads

The producer-consumer problem is one of the greatest hits of computer science. The classic solution involves some sort of queue data structure and an event or two to notify the consumer(s). Let’s take a look at a simple implementation and…

By Brian Rogers | 4 November, 2018 | concurrency, performance, testing | 4 Comments |
Read more

Operation throttle: part 2

Last time, I introduced the topic of fixed operation rates and how one might implement this functionality with ad-hoc code. Today, I will generalize the concept with a simple Throttle library. As I mentioned before, we have to keep track…

By Brian Rogers | 28 October, 2018 | design, performance, testing | 1 Comment |
Read more

Operation throttle: part 1

A while back I discussed some design points relating to fixed concurrency, such as when attempting to ensure a constant number of simultaneous active requests throughout a load test. Today I will jump back to the single-threaded world and discuss…

By Brian Rogers | 21 October, 2018 | design, performance, testing | 1 Comment |
Read more

Find the issue: tainted strings

In a previous post, we introduced a wrapper object for some method parameters: In terms of encapsulation and validation, this was a marked improvement. But there is one critical issue here. Let’s zoom in on the auditMessage parameter. In context,…

By Brian Rogers | 14 October, 2018 | design, tdd | No Comments |
Read more
  • « Previous
  • Next »
Copyright ©2025 WriteAsync .NET | Theme by: Theme Horse | Powered by: WordPress