Packing Bools, Performance tests

Imagine you have an array of booleans (or an array of ‘conditions’), and you want to pack it - so you use only one bit per boolean. How to do it? Let’s do some experiments! Updated: 8th May 2017 Read the second part here and also one update. Motivation I started writing this post because I came across a similar problem during my work some time ago.

READ MORE...

C++18, Why not?

As you’ve might already notice I’ve made a little joke on Saturday, which was the April Fools’ Day. I got the courage to announce C++18 next year! :) While it was a bit funny, I didn’t expect much traffic (as it was Saturday). Still, my stats shows that a lot of people clicked and viewed the post.

READ MORE...

Windows File Tests

You want to transform one file into another, input into output. What API will you choose on Windows? WinApi? C++ Streams or good old stdio? Last year in September I looked at four ways of processing a file on Windows. Also, I did some performance tests. The whole project description was recently published in Visual Studio Magazine.

READ MORE...

Google benchmark library

Some time ago I wrote about micro benchmarking libraries for C++ - here’s the link. I’ve described three libraries: Nonius, Hayai, Celero. But actually, I wanted to cover fourth one. Google Benchmark library was at that time not available for my Windows environment, so I couldn’t test it. Fortunately, under the original post I got a comment saying that the library is now ready for Visual Studio!

READ MORE...

The Matrix Updated

Sometimes you can find interesting stuff in your past projects! One day I was thinking about new post topics for the blog, but somehow, I got not much energy to do it. So, I just browsed through my very old projects (that are actually listed in my portfolio site). Memories came back and I decided maybe it’s time to refresh the ancient code files!

READ MORE...

Flexible Particle System - Summary

It’s been one year since the first posts about my particle system: a demo in March and then an introduction in April. Last time I wrote about renderer updates and this was the last planned post for the series. I think most of requirements were achieved and I can be quite happy about the results.

READ MORE...

Flexible particle system - Renderer optimization

Finally, I managed to finish the adventure with my particle system! This time I’d like to share some thoughts about improvements in the OpenGL renderer. Code was simplified and I got little performance improvement. The Series Initial Particle Demo Introduction Particle Container 1 - problems Particle Container 2 - implementation Generators & Emitters Updaters Renderer Introduction to Software Optimization Tools Optimizations Code Optimizations Renderer Optimizations Summary The most recent repo: particles/renderer_opt @github

READ MORE...

Flexible particle system - OpenGL Renderer

As I wrote in the Introduction to the particle series, I’ve got only a simple particle renderer. It uses position and color data with one attached texture. In this article you will find the renderer description and what problems we have with our current implementation. The Series Initial Particle Demo Introduction Particle Container 1 - problems Particle Container 2 - implementation Generators & Emitters Updaters Renderer (this post) Introduction to Optimization Tools Optimizations Code Optimizations Renderer Optimizations Summary Introduction The gist is located here: fenbf / ParticleRenderer

READ MORE...

Vector of Objects vs Vector of Pointers Updated

In one of my previous post I wrote about performance differences between using vector<Obj> and vector<shared_ptr<Obj>>. Somehow I knew that the post is a bit unfinished and need some more investigation. This time I will try to explain memory access patterns used in my code and why performance is lost in some parts.

READ MORE...

Flexible particle system - Emitter and Generators

In our particle system we have already a basic foundation: the container and the framework. Now we need some modules that can actually wake particles. In this post I will describe the emitter module and generators. The Series Initial Particle Demo Introduction Particle Container 1 - problems Particle Container 2 - implementation Generators & Emitters (this post) Updaters Renderer Introduction to Optimization Tools Optimizations Code Optimizations Renderer Optimizations Summary Introduction Basic design:

READ MORE...

Vector of object vs Vector of pointers

After watching some of the talks from Build 2014 - especially “Modern C++: What You Need to Know” and some talks from Eric Brumer I started thinking about writing my own test case. Basically I’ve created simple code that compares vector<Obj> vs vector<shared_ptr<Obj>> The first results are quite interesting so I thought it is worth to describe this on the blog.

READ MORE...