Global Game Jam 2012: Planes on a Snake
youtu.be/OioDA9mvqjANot downloaded yet
In this archive from Dec 2010 to May 2015
EDIT: SOLVED! See below... I'm setting up an XBMC machine with CentOS 6 on modern hardware (Intel quad core, nVidia GTX 470, etc.). I'm not using a window manager or desktop environment. On boot mingetty logs in as the xbmc user, who fires off XBMC from the .xinitrc. Everything's working swimmingly....
This is why they're salaried. So the company doesn't have to pay overtime.
Just because I wouldn't use Arch on my production servers doesn't mean it has no value in a VM environment. I run Arch on my personal servers because it's what I'm most familiar with and I don't have anything mission critical running. It's also easier and cleaner to play around with latest versions of things on Arch.
I don't completely disagree with him. Story time.
I was writing a ray tracer a couple years back and had fleshed out a decent vector class. I used good software engineering principles, adding getters and setters to the x/y/z/w components of the vector. I couldn't for the life of me imagine ever adding anything to them, but hey, that's what the software engineering dogma said to do, so I did it.
When I was nearly finished I decided to do some profiling to see if there were any obvious hot spots I could improve. The usual suspects showed up near the top (intersection testing against the acceleration structure, etc.), but some of the most unexpected (and disturbing) contenders were my vector accessors. They weren't the top offender, but why on earth were they taking up any noticeable share of CPU time?
Well, the fact is that in a ray tracer, those vector accessors are going to get hit a lot. By a lot, I mean that in a reasonably sized scene you're going to see millions, billions, possibly even trillions of calls to your vector accessors. They're used for points, rays, colors, and a whole host of other things.
Thankfully the fix was trivial. I marked the accessors
inlineand the function call overhead completely disappeared from the profiling results and I got a noticeable (10-20%) speedup.The moral of this story? Following the software engineering dogma is not always the right thing to do. The best programmers know the rules and follow them most of the time, but know when it's right to break them and are not afraid to do so.
TL;DR:
Accessor functions have a cost. They are not free, in programmer-time or execution-time. Rather than always adding them blindly, think about whether or not you might reasonably need them in the future, and how many times they might be called. No reason to pay function call overhead for something you don't need. They're also always worth questioning for POD types, since the common usage patterns for them are usually different from instantiated classes.
No, no no!
Multithreading using a dataflow model is very bad in software. It works great in hardware (CPUs, GPUs) because they're designed as synchronous machines driven by a single clock with virtually no communication cost between stages of the pipeline. These assumptions do not hold true for software.
First, the communication cost between stages in the pipeline is expensive, and it's multiplied by the number of stages in the pipeline and the number of objects being pushed though it. Suddenly communication costs become a huge part of what you're doing. That's time you could be spending doing useful work.
Secondly, it doesn't scale. Your parallelism is permanently fixed at the number of stages you designed into your pipeline. The ideal case is when the processor has exactly the same number of cores as stages in the pipeline. If you have more cores, they're unused and wasted, if you have fewer cores, you have to context switch between them. If you want your software to scale as new chips roll off the assembly line, you can't use a model that has a fixed number of threads.
Lastly, pipelines increase bandwidth at the cost of increased latency. You are pushing out more work per unit of time, but the overall time from beginning work to finishing it is increased as well. Real-time applications typically suffer from increases in latency.
Yeah we should all stop listening to Einstein because he was wrong about quantum mechanics.