[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
x[foo]
should be slower than
y[foo]
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
or
objdump -d example
will show you disassembled code.
Eric
- [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, Achilleas Anastasopoulos, 2006/05/12
- Message not available
- Message not available
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, Achilleas Anastasopoulos, 2006/05/12
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, Ilia Mirkin, 2006/05/12
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, Achilleas Anastasopoulos, 2006/05/12
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, Ilia Mirkin, 2006/05/12
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, al davis, 2006/05/12
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, Ilia Mirkin, 2006/05/12
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, John Aldridge, 2006/05/13
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, Achilleas Anastasopoulos, 2006/05/12
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed,
Eric Blossom <=
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, Achilleas Anastasopoulos, 2006/05/14
- Message not available
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, Achilleas Anastasopoulos, 2006/05/14
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, Eric Blossom, 2006/05/14
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, Eric Blossom, 2006/05/14
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, Dave Dodge, 2006/05/15
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, al davis, 2006/05/12
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, al davis, 2006/05/12
- Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, Eric Blossom, 2006/05/13
Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed, Eric Blossom, 2006/05/13