On Thu, Sep 24, 2009 at 08:51:49AM +0200, Tom Bachmann wrote: > Jonathan S. Shapiro wrote: > > we downgraded from C++ > >back to C in Coyotos, and that doing so simultaneously reduced > >complexity and increased performance. > > That's interesting to hear. Any specific reasons? (When looking at the > pistachio source every now and then, I think I can somewhat imagine why.)
I've written application code that was 30 times faster when it was written in C (i.e. lots of arrays) vs. C++ (with a nice easy to understand class hierarchy). Algorithmically they were the same and this was after we spent a while trying to get them running at the same speed. Given than a run of the C code takes a week or two, the C++ version wasn't really usable even if it was "prettier" and easier to change. As far as I could tell it was because the CPU just couldn't predict the memory reads well enough and hence it was limited by main memory latency, in C with simple arrays this wasn't a problem. It could also exploit things like RLE of in memory data structures, but this shouldn't have affected things this much. -- Sam http://samason.me.uk/
