[Top][All Lists]

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

Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed

From: Eric Blossom
Subject: Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed
Date: Sat, 13 May 2006 10:23:18 -0700
User-agent: Mutt/1.5.9i

On Fri, May 12, 2006 at 07:23:10PM -0400, Achilleas Anastasopoulos wrote:
> Ilia,
> I did profile two versions of the code (one with ANCI-C
> and another with C++ STL <vector>).
> It seems that the bottleneck is in accessing <vector>
> elements which is more expensive than accessing simple
> array elements.
> As an example
> vector<int> x;
> x[10];
> is much slower than
> int *y;
> y[10]
> The reason i started with <vector> was the clean way that
> these were instantiated, etc.
> Anyway, I am now reimplementing the code without using <vector>;
> will get back to you on this.

Achilleas, I think you're barking up the wrong tree.

There's no reason that reading or writing


should be slower than


particularly in a loop.  The compiler will load the underlying pointer
into a register and perform a simple indexed load or store.

If you're so inclined, 

  objdump -d example.o


  objdump -d example

will show you disassembled code.


reply via email to

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