[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++

From: Sam Mason
Subject: Re: C++
Date: Thu, 24 Sep 2009 11:52:13 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

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

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/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]