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.
So incase you havn't been following me. I joined Cargurus in July. At cargurus we're currently working on our mobile web experience written in react, redux and reselect. As our implementation grew so did our time to first paint.
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
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.
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