5 web perf tips for 2019

As more and more of the world is getting online, a larger part of the internet community is using the internet on lower powered devices. Making websites fast is becoming paramount. Here are 5 tips to improving you web page's performance

Continue Reading

Rebuilding this blog for performance

So many people know me as a very performance focused engineer, and as someone that cares about perf I've always been a bit embarrassed about this blog. In actual fact this blog as it sits now is fast by most people's standards. I got a new job in July, and well I work with an absolute mad lad that is making me feel pretty embarrassed with his 900ms page load times. So I've decided to build my own blog engine, and compete against him.

Continue Reading

c++, when should I use the stack or heap?

So I have started learning c++ recently, and as a .NET/Java developer I always want to write the following code.

var s = new myClass().

In c++ you have to manage memory yourself, there is no garbage collector.

If you do not use the new keyword var s = myClass() you will create that class and assign it to on the stack.

Any stack variables will be cleaned at the end of the block, so in this case s will be cleaned. However if you use var s = new myClass() s will be allocated onto the heap and must be deleted, otherwise memory leaks will occur.

To clean the variable you must call delete when you are done with the variable, this will cause the memory in the heap to be cleaned.

Continue Reading

How .ToLookup() Saved me 4 hours a week, and got me some high praise from my boss

I recently created a small utility that is ran in jenkins to create indicies in ElasticSearch.

The first versions took around 5 hours to index our massive data into elasticsearch. This was still better than the 9 hours, our old solution took, so no one was complaining.

One of the major slowdowns was a .Where() on a List<T>. When I wrote the tool this TODO was written

//TODO: use some kind of key lookup here, but we need non-unique keys and Dictionaries are unique only

Continue Reading